Jane is a very popular magician. But to perform a magic he needs the magical numbers. The magical numbers are the positive integers whose decimal representations contain the magical digits 1 and 2. For example, numbers 11, 2 are magical numbers and 7, 36 are not. But all numbers containing 1 and 2 are not magical. Jane calls a number, magical number, if the count of magical digits in it contains the magical digits only. Help Jane to find the magical number.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains 1 line contains an integer n.

**Output:**

Print on the new line "YES" if n is a magical number. Otherwise, print "NO".

**Constraints:**

1<=T<=100

1<=n<=10^{18}

**Example:**

**Input:**

4

12003

46003

31374

300000000

**Output:**

YES

NO

YES

NO

**Explanation:**

In the first example there are 2 magic digits, 2 is magic number, so the answer is "YES".

In the second example there is no magic digit, so the answer is "NO".

Author: arun03

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

devsinghindra | 80 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 443 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.