The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pronounced) reversely. For example, a Berlandish word code corresponds to a Birlandish word edoc. However, it's easy to make a mistake during the «translation». Vasya translated word *s* from Berlandish into Birlandish as *t*. Help him: find out if he translated the word correctly.
The first line contains word *s*, the second line contains word *t*. The words consist of lowercase Latin letters. The input data do not consist unnecessary spaces. The words are not empty and their lengths do not exceed 100 symbols.
s=input()
u=s.count("4")
l=s.count("7")
sm=u+l
if(sm==4 or sm==7):
    print("YES")
else:
    print("NO")
    





    
"""for i in range(int(input())):
	a=[int(k) for k in input().split()]
	b=[int(k) for k in input().split()]
	c=0
	for k in range(a[0]):
		c=(b[k]+c)%a[1]
	print(c)




x = int(input())
for i in range(x):
    n=int(input())
    l=list(map(int,input().split()))
    l.sort()
    s=0
    for j in range(len(l)-1):
       s += (l[j]-l[j+1])
    if(s%2!=0):
        for i in l:
            print(i,end=" ")
    else:
        print(-1)
        
"""
