Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of lucky digits in it is a lucky number. He wonders whether number n is a nearly lucky number.

Input

The only line contains an integer n (1 ≤ n ≤ 1018).

Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.

Output

Print on the single line "YES" if n is a nearly lucky number. Otherwise, print "NO" (without the quotes).

Examples

Input

40047


Output

NO


Input

7747774


Output

YES


Input

1000000000000000000


Output

NO

Note

In the first sample there are 3 lucky digits (first one and last two), so the answer is "NO".

In the second sample there are 7 lucky digits, 7 is lucky number, so the answer is "YES".

In the third sample there are no lucky digits, so the answer is "NO".
#coding=utf-8
import re
import sys


def factorial(n):
    if not n:
        return 1
    else:
        return reduce(lambda x, y: x * y, xrange(1, n + 1))


def fibonacci():
    a, b = 1, 1
    while True:
        yield a
        a, b = b, a + b


def is_pandigital(num, s=9):
    n = str(num)
    return len(n) == s and not '1234567890'[:s].strip(n)


def is_prime(n):
    if n <= 1:
        return False
    for i in xrange(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True


def prime_list(n):
    begin_list = [0, 0] + [1] * (n - 1)
    for i in xrange(2, int(n ** 0.5) + 1):
        if begin_list[i]:
            for j in xrange(i, n / i + 1):
                begin_list[j * i] = 0
    return [i for i in xrange(len(begin_list)) if begin_list[i] == 1]


def sum_of_divisors_of_num(number):
    result = 1
    for x in xrange(2, int(number ** 0.5) + 1):
        if number % x == 0:
            result += x
            if x != number / x:
                result += number / x
    return result


def latest_bigger_int(num):
    if float(num) < 0:
        return 0
    elif num == int(num):
        return int(num)
    else:
        return int(num) + 1


def gcd(first, second):
    if (first < second):
        first, second = second, first
    while second != 0:
        first, second = second, first % second
    return first


def main():
    str = map(int,raw_input())
    length=len([i for i in str if i==4 or i==7])
    if length==4 or length==7:
        print 'YES'
    else:
        print 'NO'


if __name__ == '__main__':
    main()
