Problem1028--Validate IP address

1028: Validate IP address

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

The IP address is in the form or A.B.C.D  where 0<= (A,B,C,D) <= 255. For example:
192.168.0.25 is a valid IP address. 192.168.256.25 is invalid. Please write a program
to output "YES" if the given IP address is valid and "NO" if it is invalid.


Input

The first line is one integer T which is the number of cases.
The following T lines, each line has a String  (might have numbers and English letters)

Output

For each case, output YES or NO, one case one line.

Sample Input Copy

3
125.23.56.49
A23.45.23.49
269.71.72.89

Sample Output Copy

YES
NO
NO

Source/Category