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
r = set(["1","9","7","4"])
for line in sys.stdin.readlines():
    if r == set(line.strip().split(" ")):
        print("YES")
    else:
        print("NO")

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

Solution (Python):
from collections import deque
N = input().split()
d = deque(N)
ans = "NO"
while(len(d)>0):
    tmp = d.pop()
    if len(tmp) < 4:
        for i in N:
            d.append(tmp+i)
    else:
        if tmp == "1974":
            ans = "YES"
            break
print(ans)

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

Solution (Python):


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

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

Solution (Python):
def read():
    N = input().strip().split()
    return N,


def solve(N):
    x = sorted(N)
    y = sorted(list("1974"))
    return x == y


if __name__ == '__main__':
    inputs = read()
    print("YES" if solve(*inputs) else "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(N.count(1) ==  N.count(9) == N.count(7) == N.count(4) == 1):
  print('YES')
else:
  print('NO')

Solution (Python):
a=input().split()
A=[]
A.append(int(a[0]))
A.append(int(a[1]))
A.append(int(a[2]))
A.append(int(a[3]))
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):
n = list(map(int, input().split()))



n.sort()



if n == [1, 4, 7, 9]:
    print('YES')

else:
    print('NO')

Solution (Python):
a = [int(i) for i in input().split()] 
set = set(a)
if set == {1,9,7,4}:
    print('YES')
else:
    print('NO')

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

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

Solution (Python):




"""








"""
import sys

def get_input():
    i = input().split(" ")
    return [int(x) for x in i]

def solve(i):
    ch =i.count(1) * i.count(7) * i.count(9) * i.count(4) 
    if ch > 0:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    solve(get_input())

Solution (Python):
n = [int(i) for i in 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):
def main():
  x = set(input().split())
  y = set(list('1974'))
  if x == y:
    print('YES')
  else:
    print('NO')


if __name__ == '__main__':
  main()

Solution (Python):
array = []
result = [1, 4, 7, 9]


array = map(int, input().split())

if sorted(array) == result:
    print('YES')
else:
    print('NO')

Solution (Python):
N = list(map(int, input().split()))
N.sort()
result = ''
for i in N:
    result += str(i)
if result == '1479':
    print('YES')
else:
    print('NO')

Solution (Python):
a=list(map(int,input().split()))
b=[1,4,7,9]
cnta=0
cntb=0
cntc=0
cntd=0

for i in range(4):
  if a[i]==1:
    cnta+=1
  if a[i]==4:
    cntb=1
  if a[i]==7:
    cntc+=1
  if a[i]==9:
    cntd+=1

if cnta==1 and cntb==1 and cntc==1 and cntd==1:
  print("YES")
else:
  print("NO")

Solution (Python):
N=input().split()
n=[ int(i) for i in N]
n.sort()
if n==[1,4,7,9]:
	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):
inputthis=str(input())

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

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

Solution (Python):
nums = [int(i) for i in input().split()]
if (not 1 in nums) or \
   (not 4 in nums) or \
   (not 7 in nums) or \
   (not 9 in nums):
   print("NO")
else:
   print("YES")

Solution (Python):
"""
A - Beginning
"""

def simple_input():
    temp_input = input().rstrip().split(' ')
    if len(temp_input) > 1:
        return temp_input
    return temp_input[0]


if __name__ == '__main__':
    
    n1,n2,n3,n4 = simple_input()
    n1 = int(n1)
    n2 = int(n2)
    n3 = int(n3)
    n4 = int(n4)   

    result = "NO"

    l = [0,0,0,0,0,0,0,0,0,0]

    l[n1] = 1
    l[n2] = 1
    l[n3] = 1
    l[n4] = 1

    if(l[1]==1 and l[9]==1 and l[7] == 1 and l[4] == 1):
        result = "YES"

    
    print(result)

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

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):
N = list(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):
n = list(map(int, input().split()))
n.sort()
val = 1000*n[0]+100*n[3]+10*n[2]+n[1]
if(val == 1974):
  print("YES")
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):
li = list(map(int, input().split()))
if (1 in li) and (9 in li) and (7 in li) and (4 in li):
  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):
ans = [1,9,7,4]
N = list(map(int,input().split()))

flag = True

for a in ans:
    if a in N:
        N.remove(a)
    else:
        flag = False

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

Solution (Python):
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


N = sorted(il(str))
N[1], N[-1] = N[-1], N[1]
N = "".join(N)
print("YES" if N == "1974" else "NO")

Solution (Python):




n = list(map(int,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):
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):
a, b, c, d = input().split()
S = a + b + c + d
if all(S.count(i) == 1 for i in ['1', '9', '7', '4']):
    print('YES')
else:
    print('NO')

Solution (Python):
ns = input().split()
if ''.join(sorted(ns)) == '1479':
    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):

import collections

Nlist = list(map(int, input().split()))
c=collections.Counter(Nlist)

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

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

Solution (Python):
a,b,c,d=map(int,input().split())
x=0
list=[]
list.append(a)
list.append(b)
list.append(c)
list.append(d)
for i in range(4):
    if list[i]==1:
        x+=1000
    elif list[i]==9:
        x+=900
    elif list[i]==7:
        x+=70
    elif list[i]==4:
        x+=4
print("YES" if x==1974 else "NO")

Solution (Python):
N1,N2,N3,N4= map(int,input().split())


N=[N1,N2,N3,N4]

answer='NO'

if N.count(1)==1 and N.count(9)==1 and N.count(7)==1 and N.count(4)==1:
    answer='YES'

print(answer)

Solution (Python):
M = [1,9,7,4]
N = [int(i) for i in input().split()]

for m in M:
	if m in N:
		continue
	else:
		print('NO')
		exit()
print('YES')
exit()

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

if "1" in a:
    if "9" in a:
      if "7" in a:
        if "4" in a:
          print("YES")
          exit()
print("NO")

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

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

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

Solution (Python):
l=list(map(int,input().split()))
s=[1,4,7,9]
flag=True
for i in l:
    if i not in s:
        flag=False
if l[0]==l[1] or l[0]==l[2] or l[0]==l[3] or l[1]==l[2] or l[1]==l[3] or l[3]==l[2]:
    flag=False
if flag:
    print('YES')
else:
    print('NO')

Solution (Python):

alist = [1,9,7,4]
listi = map(int,input().split(' '))
qlist = list(listi)

cnt = 0
if len(set(qlist)) != 4:
  print('NO')
else:
  for elm in qlist:
    if elm in alist:
      cnt+=1
  if cnt == 4:
    print('YES')
  else:
    print('NO')

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

Solution (Python):
n = input().split()
d1 = '1' in n
d2 = '9' in n
d3 = '7' in n
d4 = '4' in n
print('YES' if d1 and d2 and d3 and d4 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):
def main():
    N = list(map(int, input().split()))
    if 1 in N:
        del N[N.index(1)]
    if 9 in N:
        del N[N.index(9)]
    if 7 in N:
        del N[N.index(7)]
    if 4 in N:
        del N[N.index(4)]
    if N == []:
        return "YES"
    else:
        return "NO"

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

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

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

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

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

a={n1,n2,n3,n4}
     
b={1,9,7,4}

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

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

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

flg = 0

if a == 1 or b == 1 or c == 1 or d ==1:
    flg = flg +1
if a == 9 or b == 9 or c == 9 or d ==9:
    flg = flg +1
if a == 7 or b == 7 or c == 7 or d ==7:
    flg = flg +1
if a == 4 or b ==4 or c  ==4 or d ==4:
    flg = flg +1

if flg == 4:
    print("YES")
else:
    print("NO")

Solution (Python):
a,b,c,d=map(int,input().split())
l=[a,b,c,d]
w=0
x=0
y=0
z=0
for i in range(4):
  if l[i]==1:
    w+=1
  elif l[i]==4:
    x+=1
  elif l[i]==7:
    y+=1
  elif l[i]==9:
    z+=1
if w==x==y==z==1:
  print('YES')
else:
  print('NO')

Solution (Python):
from sys import stdin
N=(stdin.readline().rstrip())
if N.count("1")>0 and N.count("9")>0 and N.count("7")>0 and N.count("4") >0:
    print("YES")
else:
    print("NO")

Solution (Python):
import numpy as np
num = [int(i) for i in input().split()]
num = np.array(num)

is_1 = len(num[num == 1])
is_9 = len(num[num == 9])
is_7 = len(num[num == 7])
is_4 = len(num[num == 4])

if is_1 > 0 and is_9 > 0 and is_7 > 0 and is_4 > 0:
  print('YES')
else:
  print('NO')

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N1, N2, N3, N4] = [(input_raw[0]), (input_raw[1]), (input_raw[2]) ,(input_raw[3])]
    S = "1974"
    if (N1 in S) and (N2 in S ) and (N3 in S) and (N4 in S) and N1 != N2 and N1 != N3 and N1 != N4 and N2 != N3 and N2 != N4 and N3 != N4:
        print "YES"
    else:
        print "NO"


if __name__ == '__main__':
    main()

Solution (Python):
A,B,C,D=(int(i) for i in input().split())
if {A,B,C,D}=={1,9,7,4}:
    print("YES")
else:
    print("NO")

Solution (Python):
data = input()

flag = True
if data.count('1') != 1:
    flag = False

if data.count('4') != 1:
    flag = False

if data.count('7') != 1:
    flag = False

if data.count('9') != 1:
    flag = False

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

Solution (Python):
n1,n2,n3,n4=sorted(map(int,input().split()))
q=0
if n1==1:
    if n2==4:
        if n3==7:
            if n4==9:
                q=1
if q==0:
    print("NO")
else:
    print("YES")

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 = [int(n) for n in input().split()]
ans = True

if not 1 in N:
    ans = False
if not 9 in N:
    ans = False
if not 7 in N:
    ans = False
if not 4 in N:
    ans = False

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

Solution (Python):


import math
import sys
import itertools
import numpy as np


k = [int(i) for i in input().split()]


k.sort()

if k[0]==1 and k[1]==4 and k[2]==7 and k[3]==9 :
    print("YES")
else:
    print("NO")

Solution (Python):
from sys import stdin

target = [1,9,7,4]
status = 0
n = [int(i) for i in stdin.readline().rstrip().split(" ")]
for i in target:
    if i in n:
        status += 1
if status ==4:
    print("YES")
else:
    print("NO")

Solution (Python):
from itertools import permutations

n = ''.join(input().split(' '))

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

Solution (Python):
n=list(map(int,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):
a=list(map(int, input().split()))
a.sort()
if(a==[1, 4, 7, 9]):
  print("YES")
else:
  print("NO")

Solution (Python):
n = 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):
n = list(map(int, input().split(' ')))

c = [0 for _ in range(10)]

for num in n:
  c[num] += 1

flg = [1,7,9,4]
result = True

for i, count in enumerate(c):
  if i in flg:
    if count != 1:
      result = False

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

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

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):
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())
k = [a, b, c, d]
k.sort()

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

Solution (Python):
a, b, c, d = map(int, input().split())
if a+b+c+d == 21 and a*b*c*d == 252:
	print("YES")
else:
	print("NO")

Solution (Python):


import numpy
import scipy

from collections import defaultdict
from pprint import pprint

A = [int(x) for x in input().split(" ")]
B = {}
for a in A:
    B[a] = 1

if B.get(1) and B.get(7) and B.get(9) and B.get(4):
    print("YES")
else:
    print("NO")

Solution (Python):
N = 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=[int(i) for i in input().split()]

a=n.count(1)
b=n.count(9)
c=n.count(7)
d=n.count(4)
if a==1 and b==1 and c==1 and d==1:
  print('YES')
else:
  print('NO')

Solution (Python):


tmp=input()
n=[int(k) for k in tmp.split()]
x=[int(1),int(4),int(7),int(9)]
n.sort()

if n == x:
    print('YES')
else:
    print('NO')

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

Solution (Python):

s = list(map(lambda x: int(x), input().split()))
s.sort()

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

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

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

Solution (Python):
N = 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):


n = [int(a) for a in input().split()]

hoge = n.count(1)*n.count(7)*n.count(9)*n.count(4)

if hoge == 1:
    print("YES")
else:
    print("NO")

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

Solution (Python):
A = list(map(int, input().split()))
num = 1479
A = sorted(A)
if A[0] * 1000 + A[1] * 100 + A[2] * 10 + A[3] == num:
    print("YES")
else:
    print("NO")

Solution (Python):
def main():
    N1, N2, N3, N4 = input().split()
    lis = ['1', '9', '7', '4']
    if N1 in lis:
        lis.remove(N1)
    if N2 in lis:
        lis.remove(N2)
    if N3 in lis:
        lis.remove(N3)
    if N4 in lis:
        lis.remove(N4)
    if not lis:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()

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

Solution (Python):
n = list(map(str,input().split()))
a = b = c = d = 0
for i in range(4):
    if n[i] == '1':a += 1
    if n[i] == '7':b += 1
    if n[i] == '9':c += 1
    if n[i] == '4':d += 1
if a == 1 and b == 1 and c == 1 and d == 1:
    print('YES')
else:print('NO')

Solution (Python):
import itertools
import sys
n = list(map(int,input().split()))
for v in itertools.permutations(n, 4):
    if(v[0]==1 and v[1]==9 and v[2]==7 and v[3]==4):
        print("YES")
        sys.exit()
print("NO")

Solution (Python):
nums = [int(i) for i in input().split()]
ans = False
target = [1, 9, 7, 4]
and_str = {True:'YES', False:'NO'}
if 1 in nums and 9 in nums and 7 in nums and 4 in nums:
    ans = True

print(and_str[ans])

Solution (Python):
n = list(map(int, input().split()))
x1 = 0
x9 = 0
x7 = 0
x4 = 0

for i in range(4):
  if n[i] == 1:
    x1 += 1
  if n[i] == 9:
    x9 += 1
  if n[i] == 7:
    x7 += 1
  if n[i] == 4:
    x4 += 1

if min(x1, x9, x7, x4) == 1:
  print("YES")
else:
  print("NO")

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

Solution (Python):
a,b,c,d=map(int,input().split())
ls=[a,b,c,d]
num=[1,9,7,4]
for i in num:
  if i in ls:
    ls.remove(i)
if len(ls)==0:
  print('YES')
else:
  print('NO')

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

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

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

is_ok = False

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

Solution (Python):


def solve():
    N = set(map(int,input().split()))
    if len({1,9,7,4}&N) == 4:
        res = 'YES'
    else:
        res = 'NO'
    return str(res)

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

Solution (Python):
N = list(map(int, input().split()))
ans = [1, 4, 7, 9]
N.sort()
flag = True
for i in range(4):
    if(ans[i] == N[i]):
        continue
    else:
        flag = False
        break

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

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

if all(n in N for n in [1,9,7,4]):
    print("YES")
else:
    print("NO")

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

Solution (Python):
import math
import copy

def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l

arr=nCast(input().split())
ss=set()
for n in arr:
    ss.add(n)
if 1 in ss and 9 in ss and 7 in ss and 4 in ss:
    print("YES")
else:
    print("NO")

Solution (Python):
N1, N2, N3, N4 = map(int, input().split())
if set([N1, N2, N3, N4]) == set([1, 9, 7, 4]):
    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):
Ns = input().split(' ')
checkList = ['1', '9', '7', '4']
flag = [False for i in range(4)]

for n  in Ns:
    for j in range(4):
        if n == checkList[j]:
            flag[j] = True

if flag[0] and flag[1] and flag[2] and flag[3]:
    print('YES')
else:
    print('NO')

Solution (Python):

N = [int(s) for s in input().split(' ')]

is1 = False
is9 = False
is7 = False
is4 = False

for num in N:
    if num == 1:
        is1 = True
    elif num == 9:
        is9 = True
    elif num == 7:
        is7 = True
    elif num == 4:
        is4 = True
if is1 and is9 and is7 and is4:
    print("YES")
else:
    print("NO")

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

def is_1794(n):
    if 1 in n:
        if 7 in n:
            if 9 in n:
                if 4 in n:
                    return True
    return False

if(is_1794(N)):
    print("YES")
else:
    print("NO")

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

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

year=(1,9,7,4)

ans='YES'
for x in year:
  if x in N:
    continue
  else:
    ans='NO'
    break
print(ans)

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

Solution (Python):

a = [int(x) for x in 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):
def solve(arr):
  flag = [ False ] * 10
  for value in arr:
    flag[value] = True
  return 'YES' if flag[1] and flag[9] and flag[7] and flag[4] else 'NO'


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

print(solve(arr))

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):
num = 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):
nList = list(map(int, input().split()))

nList.sort()

if(nList[0]==1 and nList[1]==4 and nList[2]==7 and nList[3]==9):
  print("YES")
else:
  print("NO")

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

import itertools

tmp = list(itertools.permutations(N))

ans = "NO"

for i, j, k, l in tmp:
    val = 1000 * i + 100 * j + 10 * k + l
    if val == 1974:
        ans = "YES"

print(ans)

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

Solution (Python):
N = input()

f = False
if '1' in N:
	if '9' in N:
		if '7' in N:
			if '4' in N:
				print('YES')
				f = True

if not f:
	print('NO')

Solution (Python):
num_list = input().split(' ')

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

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

cnt = 0
for i in [1,9,7,4]:
    if i in n:
        cnt+=1
    else:
        cnt+=0
print('YES' if cnt == 4 else 'NO')

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

Solution (Python):
from collections import Counter
c = Counter(map(int, input().split()))
print("YES" if c[1] == 1 and c[9] == 1 and c[7] == 1 and c[4] == 1 else "NO")

Solution (Python):
n = input().split()
s = '1974'
ans = 'YES'
for i in s:
    if not i in n:
        ans = 'NO'
print(ans)

Solution (Python):
N= map(int, raw_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):
s = input()

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

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

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

if S=={1,7,9,4}:
    print('YES')
else:
    print('NO')

Solution (Python):
n = list(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):


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



ans = 0

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):
s = list(map(int,input().split()))
p = [1,9,7,4]
for i in s:
    if i in p:
        p.remove(i)
    else:
        print('NO')
        exit()
else:
    print('YES')

Solution (Python):
s = raw_input().split()
s.sort()
print "YES" if ''.join(s) == '1479' else "NO"

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

S.sort()

if S[0]==1 and S[3]==9 and S[2]==7 and S[1]==4:
  print("YES")
else:
  print("NO")

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

Solution (Python):
def m():
    s = input().split()
    if '1' in s and '9' in s and\
        '7' in s and '4' in s:
        return 'YES'
    else:
        return 'NO'

print(m())

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

Solution (Python):
a, b, c, d = map(int, input().split())
A = [a,b,c,d]
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):
print(["NO", "YES"][sorted(input().split()) == sorted("1974")])

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

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

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

Solution (Python):
def main():
    nums = input().split()

    if nums.count('1') == 1 and nums.count('9') == 1 and nums.count('7') == 1 and nums.count('4') == 1:
        print('YES')
    else:
        print('NO')

    return

main()

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

Solution (Python):
pro = input()

try:
  pro.index('1')
  pro.index('9')
  pro.index('7')
  pro.index('4')
  print('YES')
except:
  print('NO')

Solution (Python):
N = list(map(int, input().split()))
include = True
for i in [1, 9, 7, 4]:
    if i not in N:
        include = False
        break

if include:
    print("YES")
else:
    print("NO")

Solution (Python):
n = list(map(int, input().split()))
check = sum(x==1 for x in n) * sum(x==9 for x in n) * sum(x==7 for x in n) * sum(x==4 for x in n)
if check == 1:
  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 = list(map(int,input().split()))
k = 1
for i in a:
	if i == 1 or i == 7 or i == 9 or i == 4:
		k *= i

if k == 252:
	print("YES")
else:
	print("NO")

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

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

s = [1, 4, 7, 9]

if inp == s:
    print("YES")
else:
    print("NO")

Solution (Python):
n,m,k,l = map(int,input().split())
lst = [n,m,k,l]

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

Solution (Python):
Nlist = list(map(int,input().split()))
counter = 0
if Nlist.count(1) == 1:
    if Nlist.count(9) == 1:
        if Nlist.count(7) == 1:
            if Nlist.count(4) == 1:
                counter = 1
                print("YES")
if counter == 0:
    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):
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):
ans = 'YES' if set(input().split()) == set('1974') else 'NO'
print(ans)

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

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

ans = 'NO'
if N.count(1)==1:
    if N.count(9)==1:
        if N.count(7)==1:
            if N.count(4)==1:
                ans = 'YES'
    
print(ans)

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

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