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".
'''try:
  t=int(input())
  for z in range(t):
    n=int(input())
    
    if(n&n-1==0):
        
        print("-1")

    else:
 
        print(2,3,1, end=" ")
        i=4
        while(i<n+1):
            if(i & i-1 ==0):
                print(i+1,i,end=" ")
                i+=2
            else:
                print(i,end=" ")
               
                i+=1
        print()


        
        




      
    
except:
  pass

def f(n):
    if(n==1):
        return 1
    
    
    c=1
    for i in range(1,int(n**0.5)+1):
        if(n%i==0):
            c+=1
    
  
    return c
t=int(input())
for z in range(t):
    n=int(input())
    if(n==1):
        print(1)
    else:
        ans=0
        for i in range(1,n):
            ans+=f(i)

            if(ans>=n):
                break
        print(i)


x,y,z=map(int,input().split())
s=input()
a=s[:y]
b=s[y+1:]
a=sorted(a)
b=sorted(b)
ans=[]
for i in range(y):
    for j in range(y):
        s1=a[i]+b[j]
        ans.append(s1)
print(ans[z-1])'''


'''/s=input()
t=input()
ans=""
i=0
j=0
n1=len(s)
n2=len(t)
while(i<n1 and j<n2):
    ans+=s[i]
    ans+=t[j]
    i+=1
    j+=1
while(i<n1):
    ans+=s[i]
    i+=1
while(j<n2):
    ans+=t[j]
    j+=1
print(ans'''

'''a=[[1,2],[3,4],[5,18],[6,8]]
b=a.copy()
a.sort(key=lambda x:x[1])
print(*a)
print(*b)
i=3
ind=b.index(a[i])
print(ind)


def rev(n):
    a=[]
    while(n>=1):
        a.append(n%10)
        n=int(n//10)
    rev_n=0
    s=len(a)
    for i in range(len(a)):
        rev_n+=(a[i]*pow(10,s-1-i))
    return rev_n


t=int(input())
for z in range(t):
    n,m=map(int,input().split())
    n1=rev(n)
    n2=rev(m)
    s=n1+n2
    print(rev(s))'''


s=input()
c1=s.count("4")
c2=s.count("7")
if(c1+c2==4 or c1+c2==7):
    print("YES")
else:
    print("NO")