Problem:
 Score : 100 points    Problem Statement 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 ".      Constraints  0 \leq N_1, N_2, N_3, N_4 \leq 9  N_1, N_2, N_3 and N_4 are integers.         Input Input is given from Standard Input in the following format:  N_1  N_2  N_3  N_4       Output If N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits " 1974 ", print YES ; if they cannot, print NO .        Sample Input 1 1 7 9 4      Sample Output 1 YES  We can get 1974 by swapping N_2 and N_3 .       Sample Input 2 1 9 7 4      Sample Output 2 YES  We already have 1974 before doing anything.       Sample Input 3 1 2 9 1      Sample Output 3 NO       Sample Input 4 4 9 0 8      Sample Output 4 NO

Solution (Python):
import sys
N1, N2, N3, N4 = map(str, input().split())
tmp = N1 + N2 + N3 + N4

for i in '1974':
    if tmp.count(i) != 1:
        print('NO')
        sys.exit()

print('YES')

Solution (Python):
s = input().split()
s.sort()

if ("".join(s)=="1479"):
    print("YES")
else:
    print("NO")

Solution (Python):
S=list(map(int,input().split()))
T=[1,4,7,9]
S.sort()
print("YES" if S==T else "NO")

Solution (Python):
def resolve():
    abcd = list(input().split())
    print("YES" if "".join(sorted(abcd)) == "1479" else "NO")


if __name__ == "__main__":
    resolve()

Solution (Python):
k = input()
if ("1" in k) & ("9" in k) & ("7" in k) & ("4" in k):
  print("YES")
else:
  print("NO")

Solution (Python):
s = input().split()
s.sort()

if(''.join(s)=="1479"):
    print("YES")
else:
    print("NO")

Solution (Python):
inp=input().split()
ans="1 9 7 4".split()
if sorted(inp)==sorted(ans):
  print("YES")
else:
  print("NO")

Solution (Python):
N1, N2, N3, N4 = map(int, input().split())
N1, N2, N3, N4 = sorted([N1, N2, N3, N4])
if [N1, N2, N3, N4] == [1, 4, 7, 9]:
  print("YES")
else:
  print("NO")

Solution (Python):
a,b,c,d=map(int, input().split())
l=[a,b,c,d]
if 1 in l and 9 in l and 7 in l and 4 in l:
	print('YES')
else:
	print('NO')

Solution (Python):
def main():

    N = list(input().split())
    N.sort()
    if N[0] + N[3] + N[2] + N[1] == "1974":
        return "YES"
    return "NO"


if __name__ == '__main__':
    print(main())

Solution (Python):
N=list(map(int,input().split()))
print("YES" if len(set(N))==4 and (1 in N and 9 in N and 7 in N and 4 in N) else "NO")

Solution (Python):
N = input().split()
flag = True
for i in "1974":
    if not i in N:
        flag = False
print("YES") if flag else print("NO")

Solution (Python):
n = list(map(int,input().split()))
l = [1,9,7,4]
if sorted(l) == sorted(n):
    print("YES")
else:
    print("NO")

Solution (Python):
N = list(map(int,input().split()))

if 1 in N and 9 in N and 7 in N and 4 in N:
    print("YES")
else:
    print("NO")

Solution (Python):
a,b,c,d = map(int,input().split())
print("YES" if {1,9,7,4} == set([a,b,c,d])else "NO")

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = list(map(str, input().rstrip('\n').split()))
    n.sort()
    print("YES" if "".join(n) == "1479" else "NO")


if __name__ == '__main__':
    slove()

Solution (Python):
import itertools
N = input().split()
for x in itertools.permutations(N):
    num = int("".join(x))
    if num == 1974:
        print("YES")
        exit()
print("NO")

Solution (Python):
n = list(map(int, input().split()))
ans = [1 , 4, 7, 9]
n.sort()
if n == ans:
  print("YES")
else:
  print("NO")

Solution (Python):
n = list(input().split())
myStr = "1974"

if len(set(n))==4 and n[0] in myStr and n[1] in myStr and n[2] in myStr and n[3] in myStr:
  print("YES")
else:
  print("NO")

Solution (Python):
print("YNEOS"[set(input())!=set("1974 ")::2])

Solution (Python):
a = list(map(int,input().split()))
a.sort()
if a[0] == 1 and a[1] == 4 and a[2] == 7 and a[3] == 9:
    print('YES')
else:
    print('NO')

Solution (Python):
li = list(map(int,input().split()))
if 1 in li and 4 in li and 7 in li and 9 in li:
    print("YES")
else:
    print("NO")

Solution (Python):
nums = list(map(int, input().split()))
print("YES") if 4 in nums and 1 in nums and 9 in nums and 7 in nums else print("NO")

Solution (Python):



N = list(map(int, input().split()))



def hantei(N):
    if not 1 in N:
        return False
    if not 9 in N:
        return False
    if not 7 in N:
        return False
    if not 4 in N:
        return False
        
    return True
    
if hantei(N):
    print('YES')
else:
    print('NO')

Solution (Python):
N = list(map(int, input().split()))
N = sorted(N)
if N == [1, 4, 7, 9]:
  print("YES")
else:
  print("NO")

Solution (Python):
x = [int(i) for i in input().split()]
s = '1974'
import sys
for i in x:
    if str(i) not in s:
        print('NO')
        sys.exit()
print('YES') if sum(x) == 21 else print('NO')

Solution (Python):
a=set(map(int,input().split()))
print('YES' if 1 in a and 9 in  a and 7 in a and 4 in a else 'NO')

Solution (Python):
da=list(map(int,input().split()))
da=sorted(da)
li=[1,4,7,9]
if(da==li):
    print('YES')
else:
    print('NO')

Solution (Python):
N = list(map(int, input().split()))
print("YES" if len(set(N)) == 4 and 1 in N and 9 in N and 7 in N and 4 in N else "NO")

Solution (Python):
N = [int(x) for x in input().split(' ')]
N = sorted(N)

ans_list = [N[0]] + sorted(N[1:4], reverse = True)
ans = ''.join(map(str, ans_list))

if ans == '1974':
    print('YES')
else:
    print('NO')

Solution (Python):
s = list(map(int,input().split()))
if 1 in s and 9 in s and 7 in s and 4 in s:
    print('YES')
else:
    print('NO')

Solution (Python):
n=sorted(list(map(int,input().split())))

print('YES' if n[0]==1 and n[1]==4 and n[2]==7 and n[3]==9 else 'NO')

Solution (Python):
n=set(input().split())
s=set([i for i in "1974"])
print("NO" if n^s else "YES")

Solution (Python):
N = input().split()

if set(N) == set("1794"):
    print("YES")
else:
    print("NO")

Solution (Python):
a = list(map(int, input().split()))
count_a = 0
count_b = 0
count_c = 0
count_d = 0

for i in range(4):
    if a[i] == 1:
        count_a += 1
    if a[i] == 4:
        count_b += 1
    if a[i] == 7:
        count_c += 1
    if a[i] == 9:
        count_d += 1

if count_a == 1 and count_b == 1 and count_c == 1 and count_d == 1:
    print('YES')
else:
    print('NO')

Solution (Python):
f = sorted(map(int,input().split())) == [1,4,7,9]
print('YES' if f else 'NO')

Solution (Python):
N = list(input().split())

if N.count("1") == N.count("9") == N.count("7") == N.count("4") == 1:
    print("YES")
else:
    print("NO")

Solution (Python):
n=sorted(list(map(int,input().split())))
a=[1,4,7,9]
for i in range(4):
    if a[i]!=n[i]:
        print("NO")
        exit()
print("YES")

Solution (Python):
N=sorted(list(map(int,input().split())))
if N[0]==1 and N[1]==4 and N[2]==7 and N[3]==9:
  print("YES")
else:
  print("NO")

Solution (Python):
xs = list(map(int, input().split()))
if 1 in xs and 7 in xs and 9 in xs and 4 in xs:
    print("YES")
else:
    print("NO")

Solution (Python):
if set(list(map(int, input().split()))) == {1, 4, 7, 9}:
	print("YES")
else:
	print("NO")

Solution (Python):
n = [int(item) for item in input().split()]
n.sort()
if n[0] == 1 and n[1] == 4 and n[2] == 7 and n[3] == 9:
    print("YES")
else:
    print("NO")

Solution (Python):
N = list(map(int, input().split()))

if 1 in N and 9 in N and 7 in N and 4 in N:
  print("YES")
else:
  print("NO")

Solution (Python):
if [1,4,7,9] == sorted(list(map(int,input().split()))):
  print("YES")
else:
  print("NO")

Solution (Python):
print(["YES", "NO"][not(set(input().split()) == set("1974"))])

Solution (Python):

def main():
    N = set(map(int, input().rstrip().split()))
    print("YES" if N == {1, 4, 7, 9} else "NO")


if __name__ == "__main__":
    main()

Solution (Python):
n = list(map(int, input().split()))

if 1 in n and 4 in n and 7 in n and 9 in n:
    print('YES')
else:
    print('NO')

Solution (Python):
line = input().split()
d = {}
for i in line:
    d[i] = True

if "1" in d and "9" in d and "7" in d and "4" in d:
    print("YES")
else:
    print("NO")

Solution (Python):
N = sorted(map(int,input().split()))
if N == [1,4,7,9]:print("YES")
else:print("NO")

Solution (Python):
num = sorted([ int(v) for v in input().split() ])
if num == [1,4,7,9]:
    print("YES")
else:
    print("NO")

Solution (Python):
l = sorted(input().split())
if ''.join(l) == '1479':
    print('YES')
else:
    print('NO')

Solution (Python):
n = input()

if '1' in n and '9' in n and '7' in n and '4' in n:
    print('YES')
else:
    print('NO')

Solution (Python):
N = sorted(list(map(int, input().split())))

if N == [1, 4, 7, 9]:
    print('YES')
else:
    print('NO')

Solution (Python):
nlist=input().split()
nlist.sort()


nstr="".join(nlist)

if nstr == "1479":
  print("YES")
else:
  print("NO")

Solution (Python):
n=set(map(str,input().split()))
k={'1','9','7','4'}
if n==k:
    print('YES')
else:
    print('NO')

Solution (Python):
s = list('1974')
for n in input().split():
    if(not n in s):
        print('NO')
        break
    else:
        s.remove(n)
else:
    print('YES')

Solution (Python):
c = list(map(int, input().split()))
c.sort()
if c == [1, 4, 7, 9]:
    print("YES")
else:
    print("NO")

Solution (Python):
ans=[1,4,7,9]
a,b,c,d=map(int,input().split())
list=sorted([a,b,c,d])
if ans==list:
    print("YES")
else:print("NO")

Solution (Python):
a,b,c,d = map(int, input().split())
l = [a,b,c,d]
ll = [1,9,7,4]
l.sort()
ll.sort()
if l == ll:
    print("YES")
else:
    print("NO")

Solution (Python):
ans = list(map(str, input().split()))
if ("1" in ans) and ("9" in ans) and ("7" in ans) and ("4" in ans):
    print("YES")
else:
    print("NO")

Solution (Python):
n = [int(i) for i in input().split()]
n.sort()
if n == [1,4,7,9]:
    print("YES")
else:
    print("NO")

Solution (Python):
a=set(list(map(int,input().split())))
if a=={1,9,7,4}:
  print("YES")
else:
  print("NO")

Solution (Python):
A = list(map(int,input().split()))
if 1 in A and 9 in A and 7 in A and 4 in A:
  print('YES')
else:
  print('NO')

Solution (Python):
N = list(map(int, input().split()))

N.sort()

if N == [1, 4, 7, 9]:
    print ('YES')
else:
    print ('NO')

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")


N = list(map(int, sys.stdin.readline().split()))
N.sort()
a = ''.join(map(str, N))
if a == '1479':
    print('YES')
else:
    print('NO')

Solution (Python):
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


s = ''.join(str(i) for i in LI())
print('YES' if s.count('1') == s.count('7') == s.count('9') == s.count('4') == 1 else 'NO')

Solution (Python):
li = input().split()
li.sort()
answer = 'YES' if li == list('1479') else 'NO'
print(answer)

Solution (Python):
N = list(map(int, input().split()))
ans = 'NO'
if 1 in N:
  if 7 in N:
    if 9 in N:
      if 4 in N:
        ans = 'YES'
print(ans)

Solution (Python):
n = list(map(int, input().split()))
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print('YES')
        exit()
print('NO')

Solution (Python):
if sorted(list(map(int,input().split()))) == [1,4,7,9]:
    print("YES")
else:
    print("NO")

Solution (Python):
n = input()
if "1" in n and "9" in n and "7" in n and "4" in n:
	print("YES")
else:
	print("NO")

Solution (Python):
n = sorted(map(int, input().split()))
print("YES" if n == [1, 4, 7, 9] else "NO")

Solution (Python):
n = input()
if "1" in n and "9" in n and "7" in n and "4" in n:
    print("YES")
else:
    print("NO")

Solution (Python):
N = set(map(int, input().split(" ")))
if {1, 9, 7, 4} == N:
  print("YES")
else:
  print("NO")

Solution (Python):


numbers = [int(e) for e in input().split()]

numList = [1, 4, 7, 9]

if numbers[0] in numList:
    numin = numList.index(numbers[0])
    del numList[numin]

    if numbers[1] in numList:
        numin = numList.index(numbers[1])
        del numList[numin]

        if numbers[2] in numList:
            numin = numList.index(numbers[2])
            del numList[numin]

            if numbers[3] in numList:
                numin = numList.index(numbers[3])
                print('YES')

            else:
                print('NO')
        else:
            print('NO')
    else:
        print('NO')
else:
    print('NO')

Solution (Python):
a = input()
num1 = a.count("1")
num9 = a.count("9")
num7 = a.count("7")
num4 = a.count("4")
if num1 == 1 and num9 == 1 and num7 == 1 and num4 == 1:
  print("YES")
else:
  print("NO")

Solution (Python):
N=sorted([int(i) for i in input().split()])
print("YES" if N==[1,4,7,9] else "NO")

Solution (Python):
N = set(input().split())
print('YES' if N == {'1', '9', '7', '4'} else 'NO')

Solution (Python):
a = list(map(int,input().split()))
if (1 in a) & (9 in a) & (7 in a) & (4 in a) :
  print('YES')
else:
  print('NO')

Solution (Python):
N = list(map(int,input().split()))

if (1 in N) and (7 in N) and (9 in N) and (4 in N) :
    print('YES')
else:
    print('NO')

Solution (Python):
import itertools

L = list(input().split())
flag = False

for l in itertools.permutations(L, 4):
    if ''.join(l) == '1974':
        flag = True

if flag:
    print('YES')
else:
    print('NO')

Solution (Python):
nums = list(map(int, input().split()))
if 1 in nums and 9 in nums and 7 in nums and 4 in nums:
    print("YES")
else:
    print("NO")

Solution (Python):
import sys
input = sys.stdin.readline

L = [int(v) for v in input().split()]

if 1 in L and 9 in L and 7 in L and 4 in L:
    print("YES")
else:
    print("NO")

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())


s = set(input().split())

if '1' in s and '7' in s and '9' in s and '4' in s: print('YES')
else: print('NO')

Solution (Python):
*N, = map(int, input().split())
if sorted(N) == [1, 4, 7, 9]:
	print("YES")
else:
	print("NO")

Solution (Python):
n=list(map(int,input().split()))
n.sort()
ans='NO'
if n==[1,4,7,9]:
    ans='YES'
print(ans)

Solution (Python):
n=list(map(int,input().split()))
n.sort()
print('YES') if n==[1,4,7,9] else print('NO')

Solution (Python):
n1, n2, n3, n4 = map(int, input().split())
l = [n1, n2, n3, n4]
if set([1, 9, 7, 4]) == set(l):
    print("YES")
else:
    print("NO")

Solution (Python):
a=input()
print("YES" if "1"in a and "9" in a and "7" in a and "4"in a else"NO")

Solution (Python):

"""
A - Beginning
https://atcoder.jp/contests/keyence2019/tasks/keyence2019_a

"""
import sys


def solve(numbers):
    if all([n in numbers  for n in '1974']):
        return 'YES'
    return 'NO'


def main(args):
    numbers = input()
    ans = solve(numbers)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
if set([1,7,9,4]) == set(map(int,input().split())):
  print("YES")
else:
  print("NO")

Solution (Python):
N = list(map(int, input().split()))
N.sort()
if N==[1, 4, 7, 9]:
	print('YES')
else:
	print('NO')

Solution (Python):
Ns = list(input().split())
if "1" in Ns and "7" in Ns and "9" in Ns and "4" in Ns:
    print("YES")
else:
    print("NO")

Solution (Python):
n = list(map(int,input().split()))
n.sort()
if n==[1,4,7,9]:
    print("YES")
else:
    print("NO")

Solution (Python):
x = list(map(int, input().split()))
x.sort()
if x[0] == 1 and x[1] == 4 and x[2] == 7 and x[3] == 9 : print("YES")
else : print("NO")

Solution (Python):
a = set(map(int, input().split()))
if a == {1, 9, 7, 4}:
  print("YES")
else:
  print("NO")

Solution (Python):
print("YNEOS"["".join(sorted(list(input().split())))!="1479"::2])

Solution (Python):
N = set(list(map(int, input().split())))
if N == set([1,9,7,4]):
  print('YES')
else:
  print('NO')

Solution (Python):
a,b,c,d=map(int,input().split())

if a*b*c*d==252 and a+b+c+d==21:
  print("YES")
else:
  print("NO")

Solution (Python):
a=input().split()
a.sort()
if ''.join(a) == '1479':
  print('YES')
else:
  print('NO')

Solution (Python):
N = sorted(list(map(str,input().split())))
if "".join(N) == "1479":
    print("YES")
else:
    print("NO")

Solution (Python):
n1, n2 , n3, n4 = input().split()

if "".join(sorted([n1, n2, n3, n4])) == "1479":
    print("YES")
else:
    print("NO")

Solution (Python):
N = list(map(int,input().rstrip().split()))

x = 0
if 1 in N:
  x = x + 1
if 9 in N:
  x = x + 1
if 7 in N:
  x = x + 1
if 4 in N:
  x = x + 1
if x == 4:
  print('YES')
else:
  print('NO')

Solution (Python):
n= list(map(int,input().split()))
n.sort()
if 1 in n and 7 in n and 9 in n and 4 in n:
  print("YES")
else:
  print("NO")

Solution (Python):
N = list(map(int,input().split())) 
if N.count(1)==1 and N.count(7) == 1 and N.count(9) == 1 and N.count(4) == 1:
	print("YES")
else:
	print("NO")

Solution (Python):
if __name__=="__main__":
    A = [int(i) for i in input().split(' ')]
    A = sorted(A)
    if A[0] == 1 and A[1] == 4 and A[2] == 7 and A[3] == 9:
        print('YES')
    else:
        print('NO')

Solution (Python):
N = input()
if '1' in N and '7' in N and '9' in N and'4' in N:
    print('YES')
else:
    print('NO')

Solution (Python):
N = list(map(int, input().split()))
if all([(x in [1, 9, 7, 4]) for x in N]) == True:
    if len(set(N)) == 4:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Solution (Python):
N = list(map(int, input().split()))
if N.count(1) == 1 and N.count(9) == 1 and N.count(7) == 1 and N.count(4) == 1:
    print('YES')
else:
    print('NO')

Solution (Python):


N = list(map(str, input().split()))
N.sort()

x = "".join(N)

if x == "1479":
    print("YES")
else:
    print("NO")

Solution (Python):
N = [int(i)for i in input().split()]
res = "NO"
if 1 in N and 9 in N and 7 in N and 4 in N:
  res = "YES"

print(res)

Solution (Python):
a,b,c,d=map(int,input().split())
arr=[a,b,c,d]
if (arr.count(1)==1 and arr.count(9)==1) and (arr.count(7)==1 and arr.count(4)==1):
  print('YES')
else:
  print('NO')

Solution (Python):
N = sorted(list(map(str, input().split())))
print('YES' if ''.join(N) == '1479' else'NO')

Solution (Python):
a = list(map(int,input().split()))
a.sort()
print( 'YES' if a == [1,4,7,9] else 'NO' )

Solution (Python):
N_1, N_2, N_3, N_4 = map(int, input().split(' '))
set_1974 = {1, 9, 7, 4}
input_set = {N_1, N_2, N_3, N_4}

if len(set_1974 - input_set) == 0:
    print('YES')
else:
    print('NO')

Solution (Python):
n1, n2, n3, n4 = map(int, input().split())
l = [n1, n2, n3, n4]
if set([1, 9, 7, 4]) == set(l):
    print("YES")
else:
    print("NO")

Solution (Python):
nums = list(map(int,input().split()))

if 1 in nums and 4 in nums and 7 in nums and 9 in nums:
        print('YES')
else:
        print('NO')

Solution (Python):
from sys import stdin

a = set(stdin.readline().rstrip().split())

if a == set(['1', '4', '7', '9']) :
  print("YES")
else :
  print("NO")

Solution (Python):
s = list(input().split())
if '1' in s and '9' in s and '7' in s and '4' in s:
    print('YES')
else:
    print('NO')

Solution (Python):
N1,N2,N3,N4 = map(int, input().split())
numbers = sorted([N1,N2,N3,N4])
print("YES" if numbers == [1,4,7,9] else "NO")

Solution (Python):
a=list(map(int,input().split()))
if 1in a and 9in a and 7in a and 4in a:
  print("YES")
else:
  print("NO")

Solution (Python):
N = input()

if '1' in N and '7' in N and '9' in N and '4' in N:
        print("YES")
else:
        print("NO")

Solution (Python):
n = list(map(int, input().split()))
n.sort()

if n == [1, 4, 7, 9]:
  print("YES")
else:
  print("NO")

Solution (Python):
A = list(map(int,input().split()))
A.sort()
if A==[1,4,7,9]:
  print('YES')
else:
  print('NO')

Solution (Python):
a = "".join(sorted([i for i in input().split()]))

if a == "1479":
    print("YES")
else:
    print("NO")

Solution (Python):
N = input()

def is1974( N ):
    ans = ['1', '9', '7', '4']
    for i in ans:
        num = 0
        for n in N:
            if n == i: num += 1
        if num != 1:
            print( 'NO' )
            return
    print( 'YES' )

is1974( N )

Solution (Python):



def nums():
    n = list(map(int, input().split()))
    n.sort()
    if n == [1, 4, 7, 9]:
        ans = 'YES'
    else:
        ans = 'NO'
    return ans


print(nums())

Solution (Python):
N = list(map(int, input().split()))
N.sort()
print('YES' if N == [1, 4, 7, 9] else 'NO')

Solution (Python):
N = [str(_) for _ in input().split()]
S = "".join(sorted(N))
print("YES" if S == '1479' else "NO")

Solution (Python):
n=list(map(int,input().split()));n.sort()
if n==[1,4,7,9]:print("YES")
else:print("NO")

Solution (Python):
print('YES' if set(input().split())=={'1','9','7','4'} else 'NO')

Solution (Python):
N = list(map(int,input().split()))
if (1 in N) and (9 in N) and (7 in N) and (4 in N):
    print("YES")
else:
    print("NO")

Solution (Python):
A = [int(i) for i in input().split()]
A.sort()
if A == [1,4,7,9]:
  print("YES")
else:
  print("NO")

Solution (Python):
print("YES" if "".join(sorted(input().split())) == "1479" else "NO")

Solution (Python):
num_string = raw_input()


num_hash = {'1': True, '9': True, '7': True, '4': True}

for s in num_string:
  if num_hash.has_key(s):
    del num_hash[s]

if len(num_hash) == 0:
  print("YES")
else:
  print("NO")

Solution (Python):
n = sorted(list(map(int, input().split(' '))))
if n == [1,4,7,9]:
	print('YES')
else:
	print('NO')

Solution (Python):
l = set(input().split())
if l == {"1", "4", "7", "9"}:
  print("YES")
else:
  print("NO")

Solution (Python):
l=input()
s=set(l)
if '1' in s and '9' in s and '7' in s and '4' in s:
    print("YES")
else:
    print("NO")

Solution (Python):
Ns = [ int(x) for x in input().split() ]

d = set(Ns)
ans = d == set([1, 9, 7, 4])

print("YES" if ans else "NO")

Solution (Python):
l=list(map(int,input().split()))
f=True
a=[1,9,7,4]
for i in a:
	if i not in l:
		f=False
		break
if f:
	print("YES")
else:
	print("NO")

Solution (Python):
if set(input().split())==set("1974"):
	print("YES")
else:
	print("NO")

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a = sorted(LI())
    if a == [1,4,7,9]:
        return 'YES'

    return 'NO'



print(main())

Solution (Python):
if set(input().split()) == set("1974"):
  print("YES")
else:
  print("NO")

Solution (Python):
if len(set(input().split())&set("1974"))==4:
  print("YES")
else:
  print("NO")

Solution (Python):
N = [int(n) for n in input().split()]
N.sort()
if N == [1,4,7,9]:
  print("YES")
else:
  print("NO")

Solution (Python):
n=list(input().split())
n.sort()
if "".join(n)=="1479":
    print("YES")
else:
    print("NO")

Solution (Python):
print('YES' if sorted(input().split())==['1','4','7','9'] else 'NO')

Solution (Python):
clist = list(map(int,input().split()))
clist.sort()
if clist == [1,4,7,9] :
  print("YES")
else:
  print("NO")

Solution (Python):
def is1974(n1: int, n2: int, n3: int, n4: int) -> bool:
    a = sorted([n1, n2, n3, n4])
    return a[0] == 1 and a[1] == 4 and a[2] == 7 and a[3] == 9


if __name__ == "__main__":
    n1, n2, n3, n4 = [int(s) for s in input().split()]

    if is1974(n1, n2, n3, n4):
        print('YES')
    else:
        print('NO')

Solution (Python):
n = list(map(int,input().split()))
if 1 in n and 9 in n and 7 in n and 4 in n:
    print("YES")
else:
    print("NO")

Solution (Python):
L = list(map(int,input().split()))
L.sort()
c = 0
if L[0] == 1:
  c += 1
if L[1] == 4:
  c += 1
if L[2] == 7:
  c += 1
if L[3] == 9:
  c += 1
if c == 4:
  print('YES')
else:
  print('NO')

Solution (Python):
num=[int(x) for x in input().split()]
if 1 in num and 9 in num and 7 in num and 4 in num:
  print('YES')
else :
  print('NO')

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    N = list(sorted(list(map(int, input().split()))))
    if N[0] == 1 and N[1] == 4 and N[2] == 7 and N[3] == 9:
        print(YES)
    else:
        print(NO)


if __name__ == '__main__':
    main()

Solution (Python):
n=list(input().split())
n.sort()
print('YES' if n==['1','4','7','9'] else 'NO')

Solution (Python):
n=list(input())
print('YES' if '1' in n and '7' in n and '9' in n and '4' in n else 'NO')

Solution (Python):
a=[int(i) for i in input().split(" ")]
kouho=set([1,9,7,4])
for k in a:
    if k in kouho:
        kouho.remove(k)
if kouho==set([]):
    print("YES")
else:
    print("NO")

Solution (Python):
N = list(map(int,input().split()))
N.sort()
print("YES" if N == [1,4,7,9] else "NO")

Solution (Python):


import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = input().split()
N = ''.join(N)
if '1' in N and '9' in N and '7' in N and '4' in N:
    print('YES')
else:
    print('NO')

Solution (Python):
n = input().split()
if '1' in n and '9' in n and '7' in n and '4' in n:
  print('YES')
else:
  print('NO')

Solution (Python):
a, b, c, d = input().split()
s = a + b + c + d

if '1' in s and '9' in s and '7' in s and '4' in s:
	print('YES')
else:
	print('NO')

Solution (Python):
N = list(map(int, input().split()))
if 1 in N and 9 in N and 7 in N and 4 in N:
    print('YES')
else:
    print('NO')

Solution (Python):
c = '1974'
a = input().split()
for i in a:
    if i not in c:
        print('NO')
        break
else:
    if len(set(a)) != 4:
        print('NO')
    else:
        print('YES')

Solution (Python):
x = input()
num = [int(x.split()[i]) for i in range(4)]

for i in [1, 9, 7, 4]:
    if i in num:
        del num[num.index(i)]
    else :
        print('NO')
        quit()

print('YES')

Solution (Python):
x = [int(i) for i in input().split()]
x.sort()
if x==[1,4,7,9]: print("YES")
else: print("NO")

Solution (Python):
n = [int(x) for x in input().split()]
if n.count(1)==1 and n.count(9)==1 and n.count(7)==1 and n.count(4)==1:
	print('YES')
else:
	print('NO')

Solution (Python):
n = list(map(int,input().split(" ")))

if 1 in n and 7 in n and 9 in n and 4 in n:
    print("YES")
else:
    print("NO")

Solution (Python):
li = sorted(list(map(int, input().split())))
print("YES") if li == [1,4,7,9] else print("NO")

Solution (Python):
N = input().split()
if '1' in N and '9' in N and '7' in N and '4' in N:
  print('YES')
else:
  print('NO')

Solution (Python):
get=input()
get = get.split(" ")
flg=0
get=list(set(get))
for a in get:
  if int(a) in[1,9,7,4]:
    flg+=1
    
if flg==4:
  print("YES")
else:
  print("NO")

Solution (Python):
print(['NO', 'YES'][sorted(list(map(int, input().split()))) == [1, 4, 7, 9]])

Solution (Python):
def data_input():
    a,b,c,d = input().split(' ')
    return (a,b,c,d)
def answer():
    a,b,c,d = data_input()
    s = '1974'
    s = s.replace(a,'').replace(b,'').replace(c,'').replace(d,'')
    if len(s) == 0:
        print('YES')
    else:
        print('NO')
answer()

Solution (Python):
import sys

"""テンプレ"""


input = sys.stdin.readline


def intline():
    return list(map(int, input().split()))



def strline():
    return list(map(str, input().split()))



def intlines(n):
    return [int(input() for _ in range(n))]



def lines(n):
    return [input() for _ in range(n)]
    

"""ここからメインコード"""

k = intline()
k.sort()
 
if [1, 4, 7, 9] == k:
    print("YES")
else:
    print("NO")

Solution (Python):
v = [1,4,7,9]
s = list(map(int,input().split()))
s = sorted(s)
if s == v:
    print("YES")
else:
    print("NO")

Solution (Python):
n=input().split()
n.sort()
nn=['1','4','7','9']
print('YES') if n==nn else print('NO')

Solution (Python):

import sys

class YearNumberJudger:

    def __init__(self):
        self.input_num_list = []

    def input(self, num):
        self.input_num_list.append(num)

    def result(self):
        if len(self.input_num_list) != 4:
            return 'NO'
        input_map = {}
        for num in self.input_num_list:
            input_map[num] = True
        if 1 not in input_map:
            return 'NO'
        if 9 not in input_map:
            return 'NO'
        if 7 not in input_map:
            return 'NO'
        if 4 not in input_map:
            return 'NO'
        return 'YES'

year_number_judger = YearNumberJudger()
num_list = list(map(int,input().split()))

for num in num_list:
    year_number_judger.input(num)

print(year_number_judger.result())

Solution (Python):
n = input()
print('YES' if all(c in n for c in '1974') else 'NO')

Solution (Python):
s=list(map(int,input().split(" ")))
s.sort()
if s==[1,4,7,9]:
  print("YES")
else:
  print("NO")

Solution (Python):
print "YES" if sorted(map(int, raw_input().split())) == [1,4,7,9] else "NO"