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".
# vowels = ["a", "o", "y", "e", "u", "i"]
# s = list(input().lower())
# ans = ""
# for i in vowels:
#     if i in s:
#         while i in s:
#             s.remove(i)
# for i in range(len(s)):
#     s[i] = "." + s[i]
# print(ans.join(s))


# n = int(input())
# ans = 0
# for i in range(n):
#
#     s = input()
#     if "-" in s:
#         ans -= 1
#     if "+" in s:
#         ans += 1
#
#
# print(ans)

# s1 = input().lower()
# s2 = input().lower()
# isequal = False
# for i in range(len(s1)):
#     if s1[i] > s2[i]:
#         print("1")
#         isequal = True
#         break
#     if s2[i] > s1[i]:
#         print("-1")
#         isequal = True
#         break
# if not isequal:
#     print("0")

# s = list(input())
# not_dangerous = False
# for i in range(len(s)):
#     if i != len(s) - 1:
#         j = 0
#         while i + j <= len(s) - 1 and s[i] == s[i + j]:
#             j += 1
#         if j >= 7:
#             print("YES")
#             not_dangerous = True
#             break
# if not not_dangerous:
#     print("NO")


# s = list(input())
# ans = ""
# while "+" in s:
#     s.remove("+")
# s.sort()
# for i in range(len(s)):
#     if i != len(s) - 1:
#         ans += s[i] + "+"
#     else:
#         ans += s[i]
#
# print(ans)


# s = list(input())
# capital_letter = s[0]
# s = s[1:]
# ans = ""
# capital_letter = str(capital_letter).capitalize()
# s = [capital_letter] + s
# print(ans.join(s))

# import math
# matrix = []
# for i in range(5):
#     matrix.append(list(map(int, input().split())))
#     if 1 in matrix[i]:
#         (x, y) = i, matrix[i].index(1)
#
# print(str(int(math.fabs(x - 2) + math.fabs(y - 2))))

# input()
# s = list(input())
# ans = []
# counter = 0
# for i in range(len(s) - 1):
#     if s[i] == s[i + 1]:
#         counter += 1
#     else:
#         ans.append(s[i + 1])
#
# print(counter)

# s = set(list(input()))
# print("CHAT WITH HER!" if len(s) % 2 == 0 else "IGNORE HIM!")

# input()
# groups = list(map(int, input().split()))
# group_type = [0, 0, 0, 0]
# ans = 0
# for i in groups:
#     group_type[i - 1] += 1
# ans += group_type[-1]
#
# group_type[-1] = 0
#
# ans += min(group_type[0], group_type[2])
#
# if group_type[0] < group_type[2]:
#     group_type[2] = group_type[2] - group_type[0]
#     group_type[0] = 0
# elif group_type[0] == group_type[2]:
#     group_type[0] = 0
#     group_type[2] = 0
# else:
#     group_type[0] = group_type[0] - group_type[2]
#     group_type[2] = 0
#
# ans += group_type[1] // 2
#
# group_type[1] = group_type[1] % 2
#
# if group_type[0]:
#     taxi = group_type[1] * 2
#     for i in range(group_type[0]):
#         if taxi == 4:
#             ans += 1
#             taxi = 0
#         taxi += 1
#
#     if taxi:
#         ans += 1
# else:
#     ans += group_type[2]
#     if group_type[1]:
#         ans += 1
#
# print(ans)

# n = int(input())
# minimum_capacity = 0
# io_list = []
# io_recorder = 0
# for i in range(n):
#     io_list.append(tuple(map(int, input().split())))
#     if i == 0:
#         minimum_capacity = io_list[0][1]
#     io_recorder -= io_list[i][0]
#     io_recorder += io_list[i][1]
#     if minimum_capacity < io_recorder:
#         minimum_capacity = io_recorder
# print(minimum_capacity)


# n, index = map(int, input().split())
# value_list = list(map(int, input().split()))
# solved = False
# pointer = 0
# for i in range(len(value_list) + 1):
#     if pointer == index - 1:
#         print("YES")
#         solved = True
#         break
#     if pointer < len(value_list):
#         pointer += value_list[pointer]
# if not solved:
#     print("NO")

# import math
#
# n = int(input())
# list1 = list(map(int, input().split()))
# m = int(input())
# list2 = list(map(int, input().split()))
#
# graph = dict()
#
# for i in list1:
#     graph[i] = []
# if n > m:
#     n, m = m, n
#     list1, list2 = list2, list1
#
# for i in list1:
#     for j in list2:
#         if math.fabs(i - j) == 1:
#             graph[i].append(j)
#
# value_list = sorted(list(graph.values()))
# # while graph:
# for i in value_list:
#

# k, n, w = map(int, input().split())
# cost = 0
# for i in range(w):
#     cost += (i + 1) * k
# if cost - n > 0:
#     print(cost - n)
# else:print("0")

# n = int(input())
# xi = 0
# yi = 0
# zi = 0
# for i in range(n):
#     xyz = list(map(int, input().split()))
#     xi += xyz[0]
#     yi += xyz[1]
#     zi += xyz[2]
# if xi == yi == zi == 0:
#     print("YES")
# else:
#     print("NO")

#
# import sys
# s = input()
# print("YES" if "H" in s or "Q" in s or "9" in s else (print("NO"), sys.exit()))

# s = input()
# is_changed = False
# if s.isupper():
#     print(s.lower())
#     is_changed = True
#
# if ord(s[0]) > 96 and (s[1:].isupper() or len(s) == 1):
#     print(s[0].upper() + s[1:].lower())
#     is_changed = True
# if not is_changed:
#     print(s)


# ans = 0
# for i in range(int(input())):
#     p, q = map(int, input().split())
#     if q - p >= 2:
#         ans += 1
# print(ans)


# n, t = map(int, input().split())
# main_list = list(input())
# for i in range(t):
#     j = 0
#     while j < n:
#         if j != n - 1:
#             if main_list[j] == "B" and main_list[j + 1] == "G":
#                 main_list[j], main_list[j + 1] = main_list[j + 1], main_list[j]
#                 j += 1
#         j += 1
# print("".join(main_list))


# number = list(map(int, list(input())))
# length = len(number)
# i = 0
# while number[i] in [1, 2, 3, 5, 6, 8, 9, 0]:
#     number.remove(number[i])
#     i += 1
# if len(number) in [4, 7]:
#     print("YES")
# else:
#     print("NO")
ans = 0
number = list(map(int, list(input())))
for i in number:
    if i == 4 or i == 7:
        ans += 1
    if ans > 7:
        break
if ans == 7 or ans == 4:
    print("YES")
else:
    print("NO")



# def odd_sum (n):
#     return ((1 + n)/2) * ((n // 2) + 1)
#
#
# def even_sum (n):
#     return ((2 + n) / 2) * (n // 2)
#
#
# n = int(input())
# if n % 2 == 1:
#     # print(int(-odd_sum(n) + even_sum(n - 1)))
#     print(odd_sum(n))
#
# else:
#
#     # print(int(-odd_sum(n - 1) + even_sum(n)))
#     print(even_sum(n))
