P9875 [HackerEarth] its awsome
普及
题目描述

Quan_Lank loves awsome numbers. Awsome numbers are the positive integers whose decimal representations contain only the awsome digits 4 and 7. For example, numbers 7, 74, 4 are awsome and 5, 137, 4467 are not. Unfortunately, not all numbers are awsome. Quan_Lank calls a number nearly awsome if the number of awsome digits in it is a awsome number. He wonders whether number n is a nearly awsome number.

INPUT :

First line of Input contains no. of test cases T(T ≤ 100).
Each test case contains one line having a single integer n (1 ≤ n ≤ 10^18).

OUTPUT :

For each test case print on the single line "YES" if n is a nearly awsome number. Otherwise, print "NO" (without the quotes).

SAMPLE INPUT
2
40047
4777

SAMPLE OUTPUT
NO
YES

输入格式

见题面

输出格式

见题面

样例输入
2 40047 4777 SAMPLE
样例输出
NO YES