#C7143. Valid Telephone Number Checker

    ID: 50982 Type: Default 1000ms 256MiB

Valid Telephone Number Checker

Valid Telephone Number Checker

You are given an integer n and n strings. Each string is supposed to represent a telephone number. A telephone number is considered valid if it meets the following conditions:

  • The telephone number must consist of exactly 10 digits.
  • The first digit must be one of 7, 8, or 9.

Your task is to check each telephone number and print YES if it is valid, or NO otherwise. All the input should be read from standard input and results printed to standard output.

Note: If the telephone number contains any characters other than digits or does not meet the format, it should be classified as invalid.

inputFormat

The first line of input contains one integer, n, the number of telephone numbers to check. Each of the following n lines contains a single string representing a telephone number.

outputFormat

For each telephone number, print a line containing either YES if the telephone number is valid according to the rules, or NO if it is invalid.

## sample
2
7894561230
9876543210
YES

YES

</p>