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):
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):
print("YES" if "".join(sorted(set(input().split())))== "1479" else "NO")

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

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

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

Solution (Python):
N1, N2, N3, N4 = map(int, input().split())
a = list()
a.append(N1)
a.append(N2)
a.append(N3)
a.append(N4)
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())
print("YES" if sorted(n) == list("1479") else "NO")

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

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

Solution (Python):








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


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

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

Solution (Python):
print("YNEOS"[sorted([int(x) for x in input().split()])!=[1,4,7,9]::2])

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

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

Solution (Python):
import itertools
def main():
    num = list(map(int, input().split()))
    num.sort()

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

if __name__ == "__main__":
    main()

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    s = set(map(int, readline().split()))

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


if __name__ == '__main__':
    main()

Solution (Python):

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

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

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

Solution (Python):

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

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

if __name__ == '__main__':
    main()

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

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


if __name__ == "__main__":
    main()

Solution (Python):
import sys, math
from functools import lru_cache
import numpy as np
import heapq
from collections import defaultdict
sys.setrecursionlimit(10**9)
MOD = 10**9+7

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

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def lcm(a, b):
    return a*b//math.gcd(a, b)


def main():
    N = list(mi())
    N.sort()
    if N == [1,4,7,9]:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()

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

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 (x) for x 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 = "".join(input().split())
if s.count("1")==1 and  s.count("9")==1 and  s.count("7")==1 and  s.count("4")==1:
  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):
a = list(map(int,input().split()))
if 1 in a and 4 in a and 7 in a and 9 in a:
    print("YES")
else:
    print("NO")

Solution (Python):
n = input().split()
n.sort()
print("YES" if "".join(n) == "1479" else "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):
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  S=list(pin().split())
  T="".join(S)
  if T.count("1")==1 and T.count("9")==1 and T.count("7")==1 and T.count("4")==1:
    print("YES")
    return 
  print("NO")
  return 

main()

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

l=[1,9,7,4]
if a in l and b in l and c in l and d in l and len(set([a,b,c,d]))==4:
    print('YES')
else:
    print('NO')

Solution (Python):
arr = list(map(int, input().split()))
arr.sort()
ans = 'YES' if ''.join([str(x) for x in arr]) == '1479' else 'NO'
print(ans)

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

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

Solution (Python):
ns = list(map(int, input().split()))
n = [1, 9, 7, 4]
ok = True
for ni in ns:
    if ni in n:
        n.remove(ni)
    else:
        ok = False

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

Solution (Python):
n1, n2, n3, n4 = map(int, input().split())
if {n1, n2, n3, n4} == {1, 9, 7, 4}:
  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):
n = list(map(int, input().split()))

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

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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



if __name__ == '__main__':
    main()

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 = ''.join(sorted(input().split()))
print('YNEOS'[n != '1479'::2])

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

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

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

Solution (Python):
print('YNEOS'[{*input()}!={*'1974 '}::2])

Solution (Python):
print('YNEOS'[{*input()}!={*'1974 '}::2])

Solution (Python):
print('YNEOS'[sorted(input().split())!=['1','4','7','9']::2])

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

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

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

Solution (Python):
n = list(map(int, input().split()))
n.sort()
t = ''
for i in range(4):
  t += str(n[i])

if t == '1479':
  print('YES')
else:
  print('NO')

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

Solution (Python):
N = tuple(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(9)==1 and N.count(7)==1 and N.count(4)==1):
  print("YES")
else:
  print("NO")

Solution (Python):
A = list(map(int, input().split()))
li = [0] * 10
for i in A:
  li[i] += 1
if(li[1] == li[9] == li[7] == li[4] == 1):
  print('YES')
else:
  print('NO')

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

Solution (Python):
n = 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, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

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


if __name__ == '__main__':
    main()

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

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()))
list0_9 = [0 for i in range(10)]
for i in N:
  list0_9[i]+=1
if list0_9[1] == list0_9[4] == list0_9[7] == list0_9[9] == 1:
  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()))
n.sort()
if n == [1,4,7,9]:
  print("YES")
else:
  print("NO")

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

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

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

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

if s == c:
    print('YES')
else:
    print('NO')

Solution (Python):
l=list(map(int,input().split()));l.sort();
print("YNEOS"["".join(str(x) for x in l)!="1479"::2])

Solution (Python):
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):
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(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):
def resolve():
    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")
resolve()

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):
List=list(input().split())
if List.count("1")==1 and List.count("9")==1 and List.count("7")==1 and List.count("4")==1:
    print("YES")
else:
    print("NO")

Solution (Python):
n1, n2, n3, n4=map(int,input().split())
n=[]
n.append(n1)
n.append(n2)
n.append(n3)
n.append(n4)
if 1 in n and 7 in n and 9 in n and 4 in n:
  print('YES')
else:
  print('NO')

Solution (Python):
n1,n2,n3,n4= map(int, input().split()) 
s=set()
s.add(n1)
s.add(n2)
s.add(n3)
s.add(n4)
if s=={1,9,7,4}:
  print("YES")
else:
  print("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):
a, b, c, d = map(int, input().split())

if a==1 or a==9 or a==7 or a==4:
	if b==1 or b==9 or b==7 or b==4:
			if c==1 or c==9 or c==7 or c==4:
					if d==1 or d==9 or d==7 or d==4:
						s = a+b+c+d
						if s==21:
							print('YES')
						else:
							print('NO')
					else:
						print('NO')
			else:
				print('NO')
	else:
		print('NO')
else:
	print('NO')

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


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

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

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

if '1' in n:
    if '9' in n:
        if '7' in n:
            if '4' in n:
                print('YES')
                exit(0)

print('NO')

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N = set(IL())
if N == {1,7,9,4}:
  print("YES")
else:
  print("NO")

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

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

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

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

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

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    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")


if __name__ == '__main__':
    resolve()

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

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





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







     
def main():

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

        
if __name__ == '__main__':
    main()

Solution (Python):
n = set(map(int, input().split()))
if n == set({1, 7, 9, 4}):
  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 = list(map(int,input().split()))
if A.count(1)*A.count(4)*A.count(7)*A.count(9) == 1:
    print("YES")
else:
    print("NO")

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

Solution (Python):
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

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

if __name__ == '__main__':
    solve()

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

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

Solution (Python):
print("YNEOS"[set(map(int,input().split()))!={1,7,9,4}::2])

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N = list(map(int, input().split()))

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = set(map(int,input().split()))
print('YNEOS'[n!={1,9,7,4}::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):

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    l=list(map(int,input().split()))
    if l.count(1) and l.count(9) and l.count(7) and l.count(4):
        print('YES')
    else:
        print('NO')
    
resolve()

Solution (Python):
import sys
import math
import bisect

def main():
    A = list(map(int, input().split()))
    A.sort()
    if A == sorted([1, 9, 7, 4]):
        print('YES')
    else:
        print('NO')
    
if __name__ == "__main__":
    main()

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

Solution (Python):
N_list = [int(e) for e in input().split()]

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

Solution (Python):
n = list(map(str,input().split()))
n.sort()
ans = ''.join(n)

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

Solution (Python):
n=list(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()))
A1 = A.count(1)
A9 = A.count(9)
A7 = A.count(7)
A4 = A.count(4)
if A1 == A9 == A7 == A4 == 1:
  print("YES")
else:
  print("NO")

Solution (Python):
n = list(input().split())
n.sort()
print("YES" if "".join(n) == "1479" 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):
l = sorted(list(map(int,input().split())))

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

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

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

Solution (Python):
def resolve():
   l=list(map(int, input().split()))
   a=l.count(1)
   b=l.count(9)
   c=l.count(7)
   d=l.count(4)
   if a==b==c==d==1:
       print('YES')
   else:
       print('NO')
resolve()

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

Solution (Python):
A = list(map(str,input().split()))
a = A.count('1')
b = A.count('7')
c = A.count('9')
d = A.count('4')
if a == b == c == d == 1:
  print('YES')
else:
  print('NO')

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

Solution (Python):
box = list(input().split())
an = list("1974")
if all(a in box for a in an):
    print("YES")
else:
    print("NO")

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

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

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

if n1 in check:
    check.remove(n1)
if n2 in check:
    check.remove(n2)
if n3 in check:
    check.remove(n3)
if n4 in check:
    check.remove(n4)

if len(check) == 0:
    print('YES')
else:
    print('NO')

Solution (Python):
from sys import exit, stdin
N = set([int(_) for _ in stdin.readline().rstrip().split()])
if N == set([1,9,7,4]):
    print('YES')
else:
    print('NO')

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

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

N.sort()

if N[0]+N[2]+N[3]+N[1] == '1794':
    print('YES')
else:
    print('NO')

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


N = input().split()
N.sort()

if ''.join(N) == '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):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import Counter

s = readline().rstrip().decode()
check = ['1', '4', '7', '9']
counter = list(Counter(list(s)))
for k in counter:
    if k in check:
        check.pop(check.index(k))
if check:
    print('NO')
else:
    print('YES')

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c,d=sorted(list(map(int,input().split())))
    if a==1 and b==4 and c==7 and d==9:
        print("YES")
    else:print("NO")

if __name__=='__main__':
    main()

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

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

Solution (Python):
s = list(map(int,input().split()))
s.sort()
if s[0] == 1 and s[1] == 4 and s[2] == 7 and s[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):
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):
a,b,c,d = map(str,input().split())
s = set()
s.add(a)
s.add(b)
s.add(c)
s.add(d)
if s == {"1","9","7","4"}:
  print("YES")
else:
  print("NO")

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

Solution (Python):
N = input().split()
if all(N.count(x) == 1 for x in '1974'):
    print('YES')
else:
    print('NO')

Solution (Python):
A=[1,4,7,9]
if sorted(list(map(int,input().split())))==A:
  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):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    a1 =0
    a2=0
    a3=0
    a4=0
    for i in a:
        if i == 1:
            a1+=1
        if i == 9:
            a2+=1
        if i == 7:
            a3+=1
        if i == 4:
            a4+=1
    if a1 == a2==a3==a4 ==1:
        print("YES")
    else:
        print("NO")

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    n = LS()
    n.sort()
    if n == ["1", "4", "7", "9"]:
        print("YES")
    else:
        print("NO")
    return



if __name__ == '__main__':
    solve()

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
A = sorted(iil())
if A == [1,4,7,9]:
    print('YES')
else:
    print('NO')

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