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".
# n = int(input())
# a = [1]
# for i in range(n):
#     print(*a)
#     a = [1] + [a[j] + a[j + 1] for j in range(i)] + [1]

#a = 1
#n = int(input())
#for i in range(2, n):
#    if n % i == 0:
#        a = 0
#        break
#if a == 0:
#    print("I am way to dumb to get an answer correctly")
#    print("NO")
#else:
#    print("YES")
#    print("I am way to dumb to get an answer correctly")

#a = [int (x) for x in input().split()]
#for i in range(len(a) - 1 , -1, -1):
#    print(a[i], end = " ")


#a = [int (x) for x in input().split()]
#if len(a) % 2 == 0 :
#    for i in range (len(a) // 2 -1, -1, -1):
#        print(a[i], end = " ")
#    for j in range (len(a)//2, len(a)):
#        print(a[j], end = " ")
#else:
#    for i in range (len(a) // 2, -1, -1):
#        print(a[i], end = " ")
#    for j in range (len(a)//2, len(a)):
#        print(a[j], end = " ")

#b = []
#c = []
#a = [int (x) for x in input().split()]
#for i in range(len(a)):
#    if i % 2 == 0:
#        b.append (a[i])
#    else:
#        c.append (a[i])
#c.reverse()
#print(*b, end = " ")
#print(*c, end = " ")




#b = 1
#n = int(input())
#a = [int(x) for x in input().split()]
#for i in range(len(a)):
#    if a[i] == n:
#        b = 0
#        break
#if b == 0:
#    print( i + 1 , sep="\n")
#else:
#    print(-1)




#left = 0
#k = int(input())
#a = [int(x) for x in input().split()]
#right = len(a)
#while right - left > 1:
#    middle = (right + left) // 2
#    if k < a[middle]:
#        right = middle
#    else:
#        left = middle
#if a[left] == k:
#    print(left + 1)
#else:
#    print(-1)

#a = input()
#for i in range(0, len(a)):
#    if (i + 1) % 3 != 0:
#        print(a[i], end = " ")
#a = input()

#for i in range(0, len(a)):
#    if (i + 1) % 3 == 0 or (i + 1) % 2 == 0:
#        print(a[i], end = " ")


#print([int(elem) for i, elem in enumerate(input().split()) if i % 3 != 0])

#class Cat:
#    def __init__(self, face, paws, whiskers, belly, what_they_like, pawsonality):
#        self.face = face
#        self.paws = paws
#        self.whiskers = whiskers
#        self.belly = belly
#        self.what_they_like = what_they_like
#        self.pawsonality = pawsonality
#    def __str__(self):
#        return "face: {}\npaws: {}".format( self.face, self.paws, self.whiskers, self.belly, self.what_they_like, self.pawsonality)
#Tyson = Cat(1, 4, 18, 3.5, ["water", "food", "ropes", "blankets"], "playful, stubborn, sleepy")
#print(Tyson)

#a = list(input())
#b = list(reversed(a))
#if a == b:
#    print("YES")
#else:
#    print("NO")

#meow

#countmeow = 0
#a = list(input())
#b = list(reversed(a))
#for i in range(len(a)):
#    if a[i] != b[i]:
#        countmeow = countmeow + 1
#if countmeow == 0 and len(a) % 2 != 0:
#    print("YES")
#elif countmeow == 2:
#    print("YES")
#else:
#    print("NO")

#input()
#letmeowchange = 0
#num = input()
#a = dict()
#if len(num) > 26:
#    print(-1)
#else:
#    for letter in num:
#        if letter in a:
#            a[letter] += 1
#        else:
#            a[letter] = 1
#    for letter in a:
#        letmeowchange += a[letter]-1
#    print(letmeowchange)

#print(round(sum([float(i) for i in input().split()]), 1))


#a = [int(i) for i in input().split()]
#b = [int(j) for j in input().split()]
#for i in zip(b, a):
#    print(*i, end = " ")

#print([int(-i) if i%2==0 else int(i) for i in range(1,int(input()) + 1)])

#cb = input()
#bc = [int(i) for i in input().split()]
#a = {elem1: elem2 for elem1, elem2 in zip(cb, bc)}
#print(a)


#b = 0
#for i in range(10, 100):
#    if i % 5 != 0 and i % 7 != 0:
#        b = b + 1
#print(b)

#a = int(input())
#b = " that I hate"
#c = " that I love"
#print("I hate", end = "")
#for i in range(a - 1):
#    if i % 2 == 0:
#       print(c, end = "")
#    else:
#        print(b, end = "")
#print(" it")

#a = int(input())
#b = [int(input()) for i in range(a)]
#c = b[0]
#d = 0
#for i in b[1::]:
#    if i != c:
#        d = d + 1
#        c = i
#print(d + 1)

#input()
#letmeowchange = 0
#num = input()
#a = dict()
#if len(num) > 26:
#    print(-1)
#else:
#    for letter in num:
#        if letter in a:
#            a[letter] += 1
#        else:
#            a[letter] = 1
#    for letter in a:
#        letmeowchange += a[letter]-1
#    print(letmeowchange)

#from math import ceil
#a = int(input())
#b = [int(i) for i in input().split()]
#c = sum(b)
#
#d = {1:0, 2:0, 3:0, 4:0}
#total = 0
#r2 = 0
#for i in b:
#    if i in d:
#        d[i] += 1
#    else:
# d[i] = 1
#total = total + d[4]
#total = total + d[3]
#total = total + (d[2] // 2)
#r2 = d[2] % 2
#if r2 != 0:
#    d[1] = d[1] - 2
#    total = total + 1
#if d[1] > d[3]:
#    total += ceil((d[1] - d[3]) / 4)
#print(total)

#n = int(input())
#a = [int(i) for i in input().split()]
#print(*sorted(a))

#s = list(input())
#t = list(input())
#a = list(reversed(s))
#if t == a:
#    print("YES")
#else:
#    print("NO")

#a = input().split()
#b = 0
#c = 0
#d = dict()
#for letter in a:
#    if letter in d:
#        d[letter] += 1
#    else:
#       d[letter] = 1
#for value in d.values():
#    if value % 2 != 0:
#        c = c + 1
#if c > 1:
#    print("NO")
#else:
#    print("YES")


n = input()
a = [int(i) for i in n]
b = 0
for i in a:
    if i == 4 or i == 7:
        b = b + 1
if b == 4 or b == 7:
    print("YES")
else:
    print("NO")