You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974".
s=input()
result=False
for i in range(len(s)):
    for j in range(i,len(s)):
        if s[:i]+s[j:]=="keyence":
            result=True
            break
if result:
    print("YES")
else:
    print("NO")
N = input()
if sorted(N.split(" ")) == ["1", "4", "7", "9"]:
    print("YES")
else:
    print("NO")
