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):
s = list(input().split())

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

Solution (Python):
L=sorted(list(input().split()))
S=''.join(L)
print('YES' if S == '1479' 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):
print("YES" if set(map(int,input().split()))=={1,9,7,4} else "NO")

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

Solution (Python):
n = list(map(int, input().split()))
f = [False] * 10

for i in n:
    f[i] = True

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

Solution (Python):
s = 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=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):
n1, n2, n3, n4 = map(int, input().split())
ans = sorted(list({n1, n2, n3, n4}))
if ans == [1, 4, 7, 9]:
    print('YES')
else:
    print('NO')

Solution (Python):
li = list(input())
lia = ['1','9','7','4']
from collections import Counter
c = Counter(li)
for i in lia:
    if c[i] != 1:
        print("NO")
        exit()
print("YES")

Solution (Python):
nums = list(map(str, input().split()))
flg = False
if len(set(nums)) != 4:
    pass
else:
    for num in nums:
        if num in "1974":
            flg = True
        else:
            flg = False
            break
if flg == True:
    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):
def main():
    numbers = sorted(list(map(int, input().split())))
    print("YES" if numbers == [1, 4, 7, 9] else "NO")


if __name__ == '__main__':
    main()

Solution (Python):
a = list(map(int, input().split()))
n = [1,9,7,4]

for i in range(len(n)):
	if not(n[i] in a):
		print("NO")
		exit()

print("YES")

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

ans = [1, 4, 7, 9]

print('YES' if nums == ans else 'NO')

Solution (Python):

a = list(map(int,input().split()))
a.sort()
print("YES" if a == [1,4,7,9] else "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 = map(int,input().split())
 
li = [1,9,7,4]
 
if (a in li)and (b in li)and(c in li)and(d in li):
  if a!=b and b!=c and c!=d and a!=c and a!=d and b!=d:
	  print("YES")
  else:
    print("NO")
else:
  print("NO")

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

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

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

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

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

print(ans)

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

SEQ.sort()

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

Solution (Python):
def main():
    a = [0]*10
    b = list(map(int, input().split()))
    for v in b:
        a[v] += 1
    if a[1] == 1 and a[9] == 1 and a[7] == 1 and a[4] == 1:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()

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

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

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

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):
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):
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):
n = input()
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 = set(map(int, input().split()))

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

Solution (Python):
print("YNEOS"[int("".join(map(str,sorted(map(int, input().split())))))!=1479::2])

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

Solution (Python):
s = set(map(str, input().split()))
ans = {'1', '9', '7', '4'}
print('YES' if s==ans else '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 = [int(x) for x in input().split()]
print("YES" if sorted(n) == [1, 4, 7, 9] else "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()))
if 1 in n and 9 in n and 7 in n and 4 in n:
    print('YES')
else:
    print('NO')

Solution (Python):
def examA():
    N = LI()
    N.sort()
    if N==[1,4,7,9]:
        print("YES")
    else:
        print("NO")
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examA()

"""

"""

Solution (Python):








mod = int(1e9+7)

def main():
    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')
    return

if __name__=='__main__':
    main()

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
N = map(int, input().split())
dic = {1: False, 9: False, 7: False, 4: False}

for n in N:
  dic[n] = True

if all(dic.values()):
  print('YES')
else:
  print('NO')

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

 
import math
import itertools
import sys
import copy
 






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

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

Solution (Python):
n = set(input().split())
a = {"1", "9", "7", "4"}

print("YES" if n == a else "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):
a = sorted(list(map(int, input().split())))
if a[0] == 1 and a[1] == 4 and a[2] == 7 and a[3] == 9:
  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):
def main():
    N = list(map(int, input().split()))
    ans = [False]*4
    for n in N:
        if n == 1:
            ans[0] = True
        elif n == 9:
            ans[1] = True
        elif n == 7:
            ans[2] = True
        elif n == 4:
            ans[3] = True
    if all(ans):
        print("YES")
    else:
        print("NO")

    return 0

if __name__ == '__main__':
    main()

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

from itertools import permutations
def solve():
    n = LI()
    for p in permutations(n):
        if p == (1,9,7,4):
            print("YES")
            return
    print("NO")
    return


if __name__ == "__main__":
    solve()

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

ans = set()
ans.add(a)
ans.add(b)
ans.add(c)
ans.add(d)

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

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

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    A=list(map(int,input().split()))
    A.sort()
    print("YES" if(A==[1,4,7,9]) else "NO")
resolve()

Solution (Python):




import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

lst = LI()
if lst.count(1) == 1:
    if lst.count(7) == 1:
        if lst.count(9) == 1:
            if lst.count(4) == 1:
                print('YES')
                quit()
print('NO')

Solution (Python):
N = [int(i) for i in input().split()]
n1,n2,n3,n4=0,0,0,0
for n in N:
  if n == 1:
    n1 = 1
  elif n == 9:
    n2 = 1
  elif n == 7:
    n3 = 1
  elif n == 4:
    n4 = 1
if n1==n2==n3==n4==1:
  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):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = set(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')
    
if __name__ == '__main__':
    main()

Solution (Python):
def main():
    num_list = list(map(int,input().split()))

    good_list = [1,4,7,9]

    num_list.sort()

    if num_list == good_list:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

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

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

Solution (Python):
N = set(int(i) for i in input().split())

if len(N) == 4 and set([1,9,7,4]) == N:
    print("YES")
else:
    print("NO")

Solution (Python):
a=list(map(int,input().split()))
b=[1,7,9,4]
c=[0]*4
d=[True,True,True,True]

for i in range(4):
    c[i]=(b[i] in a)
if c==d:
  print("YES")
else:
  print("NO")

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A=LI()
    A.sort()
    if A==[1,4,7,9]:
        print("YES")
    else:
        print("NO")
if __name__ == '__main__':
    main()

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

Solution (Python):
import itertools
X,Y,Z,N=input().split()
hako=[]
hako.append(X)
hako.append(Y)
hako.append(Z)
hako.append(N)
ans = ["1","9","7","4"]
kari=[]
for v in itertools.permutations(hako,4):
    kari.append(list(v))

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

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

Solution (Python):
print("YES"if sorted(map(int,input().split()))==[1,4,7,9]else"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):
from itertools import permutations

n = list(map(int, input().split()))
for a in permutations(n):
    if a == (1, 9, 7, 4):
        print("YES")
        exit()
print("NO")

Solution (Python):
N=list(map(int,input().split()))
N.sort()
co=[1,4,7,9]

ans="YES"
for i in range(4):
    if N[i]!=co[i]:
        ans="NO"
        break
        
print(ans)

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

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

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

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a=nl()

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):
A=sorted([int(i) for i in input().split()])
if A == [1,4,7,9]:
  print("YES")
else:
  print("NO")

Solution (Python):
from sys import stdin

li = list(map(int,stdin.readline().rstrip().split()))
li.sort()

if li == [1,4,7,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):
def solve():
    S = ''.join(list(map(str, input().split())))
    if S.find('1') == -1 or S.find('9') == -1 or S.find('7') == -1 or S.find('4') == -1:
        print('NO')
    else:
        print('YES')


if __name__ == '__main__':
    solve()

Solution (Python):
def main():
    ls = [int(x) for x in input().split()]
    ls.sort()
    ans = [1,4,7,9]
    for i in range(4):
        if ls[i]!=ans[i]:
            print("NO")
            exit()
    print("YES")
if __name__ == '__main__':
    main()

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

ans=False
if len(set(a))==4:
    if 1 in a and 9 in a and 7 in a and 4 in a:
        ans=True
if ans is True:
    print("YES")
else:
    print("NO")

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

Solution (Python):
N=set(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):
import itertools
t = False
num = [s for s in input().split()]
lister = list(itertools.permutations(num))
for i in range(24):
    s = lister[i]
    if s[0] == "1" and s[1] == "9" and s[2] == "7" and s[3] == "4":
        t = True
if t == True:
    print("YES")
else:
    print("NO")

Solution (Python):
s=input()
l=list("1 9 7 4".split())
flg=True
for i in l:
  if i not in s:
    flg=False
    break

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

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

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

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

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

if len(List)==4 and 1 in List and 4 in List and 7 in List and 9 in List:
  print('YES')
else:
  print('NO')

Solution (Python):


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

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

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

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s=set()
data=[1,7,9,4]
for si in map(int,input().split()):
    if si in data:
        s.add(si)
print("YES" if len(s)==4 else "NO")

Solution (Python):
mylist = set([i for i in map(str,input().split())])

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

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

Solution (Python):
import sys

*N, = set(map(int, input().split()))

l = [1,9,7,4]

for i in range(len(l)):
    if not (l[i] in N):
        print("NO")
        sys.exit()

print("YES")

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

Solution (Python):
import sys
if sys.platform =='ios':
	sys.stdin=open('input.txt')

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

l.sort()



if ''.join(list(map(str, l)))=='1479':
	print('YES')
else:
	print('NO')

Solution (Python):
N = list(map(int,input().split()))
print('YES' if all([True if i in N else False for i in [1,4,9,7]]) 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):
n=list(map(int,input().split()))
if n.count(1)==1 and n.count(4)==1 and n.count(7)==1 and n.count(9)==1:
    print('YES')
else:
    print('NO')

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

S = set([1, 9, 7, 4])
for n in N:
    if n in S:
        S.remove(n)
    else:
        print('NO')
        exit()
else:
    print('YES')

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

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

if A == list('1479'):
	print("YES")
else:
	print("NO")

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

Solution (Python):
N = [int(i) for i in 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):
s=input();print("YNEOS"[any(x not in s for x in"1479")::2])

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

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

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

Solution (Python):
A = sorted(list(map(int,input().split())))
B = [1,4,7,9]
if A==B:
    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):

import sys
def main():
    digits = sorted(sys.stdin.readline().split())
    
    if digits == list('1479'):
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

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

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

Solution (Python):

N1, N2, N3, N4 = map(int, input().split())
L = [N1,N2,N3,N4]
L.sort()
if L == [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):
n = list(map(int, input().split()))
print('YES' if sorted(n) == [1, 4, 7, 9] else 'NO')

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = sorted(list(map(str, readline().rstrip().decode('utf-8').split())))
    print("YES" if n == sorted("1974") else "NO")


if __name__ == '__main__':
    solve()

Solution (Python):
x=list(map(int,input().split()))
x.sort()
k=1000*x[0]+x[1]+10*x[2]+100*x[3]
if k==1974:
  print("YES")
else:
  print("NO")

Solution (Python):


a=sorted(list(map(int,input().split())))
res=[1,4,7,9]
print('YES' if a==res 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):
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):
N = [int(i) for i 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 = set(map(int,input().split()))
if n == set([1,4,7,9]):
	print("YES")
else:
	print("NO")

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

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

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

Solution (Python):
li = list(map(int,input().split()))
check = [1,4,7,9]
dic = {1:0, 4:0, 7:0, 9:0}

for i in range(4):
    if li[i] in check:
        dic[li[i]] += 1
    else:
        print("NO")
        exit()

for j in check:
    if dic[j] != 1:
        print("NO")
        exit()
print("YES")

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 




 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N1,N2,N3,N4 = inputMap()
    inp = []
    inp.append(N1)
    inp.append(N2)
    inp.append(N3)
    inp.append(N4)
    flgs = [False, False, False, False]
    
    if 1 in inp:
        flgs[0] = True
    else:
        print("NO")
        sys.exit()
        
    if 7 in inp:
        flgs[1] = True
    else:
        print("NO")
        sys.exit()
        
    if 9 in inp:
        flgs[2] = True
    else:
        print("NO")
        sys.exit()
        
    if 4 in inp:
        flgs[3] = True
    else:
        print("NO")
        sys.exit()
    
    for i in flgs:
        if i == False:
            print("NO")
            ys.exit()
            
    print("YES")
    
if __name__ == "__main__":
	main()

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

Solution (Python):
n = list(map(int, input().split()))
f = 0
for i in n:
    if i == 1:
        f += 1
    elif i == 7:
        f += 10
    elif i == 9:
        f += 100
    elif i == 4:
        f += 1000
print("YES" if f == 1111 else "NO")

Solution (Python):

n = input().split()
n.sort()
print('YES' if n[0] + n[1] + n[2] + n[3] == '1479' else 'NO')

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

Solution (Python):
n,a,b,c=map(int,input().split())
ans='NO'
if n==1 or a==1 or b==1 or c==1:
    if n==9 or a==9 or b==9 or c==9:
        if n==7 or a==7 or b==7 or c==7:
            if n==4 or a==4 or b==4 or c==4:
                ans='YES'
print(ans)

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

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):
s = str(input())

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

Solution (Python):
s = str(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(map(int,input().split()))
if a=={1,9,7,4} :
    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):
N = set(input().split())

print('YES' if N == {'1', '4', '7', '9'} 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):
n=list(map(int,input().split()))
n=''.join(map(str,sorted(n)))
if n=='1479':
    print('YES')
else:
    print('NO')

Solution (Python):
n = sorted(input().split())

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

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

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


if __name__ == '__main__':
    slove()

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

Solution (Python):
n = list(map(int, input().split()))
n.sort()
str_n = list(map(str, n))
if ''.join(str_n) == '1479':
    print('YES')
else:
    print('NO')

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

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

Solution (Python):
'''A - Beginning
https://atcoder.jp/contests/keyence2019/tasks/keyence2019_a

>>> main([1,7,9,4])
YES
>>> main([1,9,7,4])
YES
>>> main([1,2,9,1])
NO
>>> main([4,9,0,8])
NO
'''


def main(n):
    n = sorted(n)

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


if __name__ == '__main__':
    n = map(int, input().split(' '))
    main(n)

Solution (Python):

l = list(map(int, input().split()))
l.sort()
for i in range(len(l)):
        l[i] = str(l[i])
a = ''.join(l)
if a == '1479':
        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):
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):

import sys

YES = "YES"  
NO = "NO"  


def solve(N: "List[int]"):
    Nmax = sorted(N)
    
    l = [Nmax[0], Nmax[3], Nmax[2], Nmax[1]]
    if ''.join(map(str,l)) == '1974':
        print(YES)
    else:
        print(NO)
    
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = [int(next(tokens)) for _ in range(4)]  
    solve(N)

if __name__ == '__main__':
    main()

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

ans=[0]*4
for i in range(4):
    if a[i]==1:
        ans[0]=1
    elif a[i]==9:
        ans[1]=1
    elif a[i]==7:
        ans[2]=1
    elif a[i]==4:
        ans[3]=1
if sum(ans)==4:
    print('YES')
else:
    print('NO')

Solution (Python):

import sys
def input():
	return sys.stdin.readline().strip()

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

set1 = [1, 9, 7, 4]
set1 = set(set1)
set2 = set(N)
if set1 == set2:
	print("YES")
else:
	print("NO")

Solution (Python):
n= map(int, input().split())
n = sorted(list(set(n)))
if n[0]==1 and n[1]==4 and n[2]==7 and n[3]==9:
  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")