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):
strings = input().split()
dict = {}
for i in range(10):
    dict[str(i)] = 0
for char in strings:
    dict[char] += 1
answer = True
for char in "1974":
    answer = answer and dict[char] == 1
if answer:
    print('YES')
else:
    print('NO')

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

Solution (Python):
def checkInput(inputList):
    a = 0
    b = 0
    c = 0
    d = 0
    for num in inputList:
        if(num == 1):
            a = 1
        elif(num == 9):
            b = 1
        elif(num == 7):
            c = 1
        elif(num == 4):
            d = 1
    if(a == 1 and b == 1 and c == 1 and d == 1):
        return True
    else:
        return False

if __name__ == '__main__':
    inp = list(map(int,input().split()))
    if(checkInput(inp)):
        print("YES")
    else:
        print("NO")

Solution (Python):

import sys

def main ():
    line = sys.stdin.readline()
    numbers = [int(x) for x in line.split(' ')]
    numbers.sort()

    
    inputStr = ''.join(str(x) for x in numbers)
    if inputStr == '1479':
        print('YES')
    else:
        print('NO')

main()

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

for i in nums:
    if i not in N:
        print("NO")
        break
else:
    print("YES")

Solution (Python):
import math

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


line=sorted(line)

if line==[1,4,7,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):
print("YES" if "" == str(input()).replace(" ", "").replace("1", "", 1).replace("9", "", 1).replace("7", "", 1).replace("4", "", 1) else "NO")

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

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

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

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

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

Solution (Python):
l = {int(e) for e in input().split()}
set_1974 = {1,9,7,4}

if l == set_1974:
  print("YES")
else:
  print("NO")

Solution (Python):
l = set([int(e) for e in input().split()])
set_1974 = set([1,9,7,4])

if l == set_1974:
  print("YES")
else:
  print("NO")

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

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

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

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

def solve():
    ans = [1, 4, 7, 9];
    for i in range(4):
        if list[i] != ans[i]:
            return False;
    return True;

if solve():
    print('YES');
else:
    print('NO');

Solution (Python):
a = [False,False,False,False]
for x in input().split():
  x = int(x)
  if(x == 1):
    a[0] = True
  elif(x == 9):
    a[1] = True
  elif(x == 4):
    a[2] = True
  elif(x == 7):
    a[3] = True
 
all = True
for x in a:
  all &= x
 
print('YES' if all else 'NO')

Solution (Python):
n1, n2, n3, n4= list(map(int, input().split()))
cand = [n1,n2,n3,n4]
result=[0,0,0,0]
for i in cand:
  if i == 1:
    result[0]=1
  elif i == 9:
    result[1]=1
  elif i == 7:
    result[2]=1
  elif i == 4:
    result[3]=1
    
if result == [1,1,1,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):
print('YES' if ''.join(sorted(input().split())) == '1479' else 'NO')

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

def A(i):
    if i in N:
        return True
    else:
        return False
    
if A(1) and A(9) and A(7) and A(4):
    print("YES")
else:
    print("NO")

Solution (Python):
l1  = input().split(" ")
ar = []
for i in l1:
  ar.append(int(i))
d = {1:0,9:0,7:0,4:0}
for i in ar:
  for j in d:
    if  i == j:
      d[j] = 1
con = True
for  i in d:
  if d[i] == 0:
    con = False
    print("NO")
    break
if con:
  print("YES")

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

Solution (Python):
N1, N2, N3, N4 = [int(_) for _ in input().split()]

ns = (N1, N2, N3, N4)

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

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

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

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

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

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

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

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

Solution (Python):
print("YES" if sorted(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):



def main():
    n = list(map(int, input().split()))
    numbers = [1, 9, 7, 4]

    for number in numbers:
        if n.count(number) != 1:
            print('NO')
            exit()

    print('YES')


if __name__ == '__main__':
    main()

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(input().split()) == ['1','4','7','9'] else "NO")

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

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

Solution (Python):
s = ''.join(sorted(input().split()))
print(['NO', 'YES'][s == '1479'])

Solution (Python):
l=raw_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):
listN = list(map(int, input().split()))
listN.sort()

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

Solution (Python):
ans={'1','9','7','4'}
n=set(map(str,input().split()))



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

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

Solution (Python):
l = list(map(int, input().split()))
list = [1, 4, 7, 9]
flg = True
for num in list:
  if(num in l):    
    pass
  else:
    flg = False
if(flg):
	print("YES")
else:
    print("NO")

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

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

Solution (Python):
L = [int(_) for _ in input().split()]
list = [1,7,9,4]
num = True
for i in L:
    if i in list:
        list.remove(i)
        pass
    else:
        num=False
if num:
    print('YES')
else:
    print('NO')

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

for s in ['1', '9', '7', '4']:
    if s not in N:
        print('NO')
        break
else:
    print('YES')

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

Solution (Python):
print(["NO","YES"]["".join(sorted(input().split())) == "1479"])

Solution (Python):
print(['NO','YES'][''.join(sorted(input().split()))=='1479'])

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

Solution (Python):

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

Solution (Python):
import math
a = 0
b = 0
c = 0
d = 0
input_str = input().split()
input_str_list = []


for x in input_str:
    try:
       input_str_list.append(int(x))
    except:
      print("NO")
      exit()

for i in range(len(input_str_list)):
  if input_str_list[i] == 1:
    a+=1
  elif input_str_list[i] == 9:
    b+=1
  elif input_str_list[i] == 7:
    c+=1
  elif input_str_list[i] == 4:
    d+=1
if a==1 and b==1 and c==1 and d==1:
  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(input().split())==sorted("1479") else "NO")

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

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

Solution (Python):
N = [int(_) for _ in input().split()]

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

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

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

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

Solution (Python):
N = [i for i in input().split()]
print('YES' if '1' in N and '9' in N and '7' in N and '4' in N 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()))
hoge = [1, 4, 7, 9]
foo = [1, 4, 7, 9]

res = True

for i in hoge:
    if i in n:
        foo.remove(i)
    else:
        res = False
        
if foo:
    res = False
    
if res:
    print("YES")
else:
    print("NO")

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

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

for x in a:
    if x not in li:
        print("NO")
        quit()

print("YES")

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

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

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

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

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

    A = [1,7,9,4]

    for a in A:
        if (not a in N):
            return False
    return True

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

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

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

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

Solution (Python):
str_input_list = input().rstrip().split(' ')
int_input_list = []
for a in str_input_list:
    int_input_list.append(int(a))
    
keyence_list = [1, 9, 7, 4]

for a in range(4):
    if keyence_list[a] in int_input_list:
        keyence_list[a] = '*'

if keyence_list == ['*', '*', '*', '*']:
    print('YES')
else:
    print('NO')

Solution (Python):
x = list(map(int,input().split()))
true=[1,9,4,7]
cnt=0
for i in x:
    if i in true:
        cnt+=1
        idx = true.index(i)
        del true[idx]
print("YES") if cnt == 4 else print("NO")

Solution (Python):

import sys

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

wk = [99 for _ in range(len(N))]
flg = True
for i in range(len(N)) :
    if N[i] == 1 or N[i] == 9 or N[i] == 7 or N[i] == 4 :
        for _ in range(len(wk)) :
            if wk[_] == N[i] :
                flg = False
                break
        if flg == False :
            break
        else :
            wk[i] = N[i]
            flg = True
    else :
        flg = False
        break

if flg == True :
    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):


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')

Solution (Python):




def solveProblem(charList):
	count = 0
	if '1' in charList:
		count = count + 1
	else:
		count = count
	if '9' in charList:
		count = count + 1
	else:
		count = count
	if '7' in charList:
		count = count + 1
	else:
		count = count
	if '4' in charList:
		count = count+1
	else:
		count = count

	if count == 4:
		result = "YES"
	else:
		result = "NO"

	answer = result
	return answer


if __name__ == '__main__':
	charList = list(map(str,input().strip().split(' ')))
	solution = solveProblem(charList)
	print("{}".format(solution))

Solution (Python):
import sys








num1, num2, num3, num4 = (int(i) for i in input().split())

num1 = str(num1)
num2 = str(num2)
num3 = str(num3)
num4 = str(num4)


strTarget = "1974"
isCheck1 = False
isCheck2 = False
isCheck3 = False
isCheck4 = False

isValidation1 = num1 in strTarget
if isValidation1 :
    strTarget = strTarget.replace(num1,"")
    isCheck1 = True

isValidation2 = num2 in strTarget
if isValidation2 :
    strTarget = strTarget.replace(num2,"")
    isCheck2 = True

isValidation3 = num3 in strTarget
if isValidation3 :
    strTarget = strTarget.replace(num3,"")
    isCheck3 = True

isValidation4 = num4 in strTarget
if isValidation4 :
    strTarget = strTarget.replace(num4,"")
    isCheck4 = True

if isCheck1 and isCheck2 and isCheck3 and isCheck4:
    print("YES")
else:
    print("NO")

Solution (Python):
a = [int(i) for i in input().split()] 
b = []
for i in a:
    if i in [2, 3, 5, 6, 8]:
        print("NO")
        break
    elif i in b:
        print("NO")
        break
    else:
        b.append(i)
        if len(b) == 4:
            print("YES")

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

Solution (Python):
x = input().split()
test = ["1", "9", "7", "4"]

for _ in x:
  if _ in test:
    test.remove(_)

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

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

Solution (Python):
line = [1, 9, 7, 4]
n = input().split(" ")

for i in range(4):
    for j in n:
        if line[i] == int(j):
            line[i] = 0
            break

if sum(line) == 0:
    print("YES")
    exit()

print("NO")

Solution (Python):

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

a = [1, 9, 7 ,4]
flg = [0, 0, 0, 0]

for i in N:
    for j in range(len(a)):
        if i == a[j]:
            flg[j] = 1
            
if sum(flg) == 4:
    print('YES')
else:
    print('NO')

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

Solution (Python):
a = [int(i) for i 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):
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()))

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

Solution (Python):

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

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):
from sys import stdin
l = stdin.readline().rstrip().split()
flug = 0
for i in [1,9,7,4]:
    if str(i) not in l:
        print("NO")
        flug = 1
        break

if(flug == 0):
    print("YES")

Solution (Python):
input_lines = raw_input().split()
num_correct = len([i for i in ['1','7','9','4'] if i in input_lines])
if 4 == num_correct:
    print('YES')
else:
    print('NO')

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

Solution (Python):
s=input();print('YNEOS'[sum(t in s for t in'1479')<4::2])

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

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

Solution (Python):
A = map(int, raw_input().split())
A.sort()

print "YES" if A == [1, 4, 7, 9] else "NO"

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

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

Solution (Python):
a = input().split()
b = [1, 9, 7, 4]
A = "YES"
for i in b:
    if a.count(str(i)) != 1:
        A = "NO"

print(A)

Solution (Python):
x = list(map(int,input().split()))
f = 0
y = [1,9,7,4]
r = 0
for i in range(len(x)):
    for j in range(4):
        if x[i] == y[j]:
            y[j] = 0
if sum(y)==0:
    print("YES")
else:print("NO")

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

N = sorted(N)

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

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

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

flag = 'YES'
for c in ncheck:
    if not c in n:
        flag = 'NO'


print(flag)

Solution (Python):
N=input().split()
ans = 0
for i in range(4):
	if N[i] == '1':
		ans += 1
		break
for i in range(4):
	if N[i] == '9':
		ans += 1
		break
for i in range(4):
	if N[i] == '7':
		ans += 1
		break
for i in range(4):
	if N[i] == '4':
		ans += 1
		break
		
if ans == 4:
	print('YES')
else:
	print('NO')

Solution (Python):
num = list(map(int, input().split()))
age = []

for i in num:
    if i == 1:
        for j in num:
            if j == 9:
                for k in num:
                    if k == 7:
                        for l in num:
                            if l == 4:
                                bool = True

if bool == True:
    print('YES')
else:
    print('NO')

Solution (Python):


import sys


def check(inp) :
    check_num = [1, 7, 9, 4]

    for a in check_num :
        if a not in inp :
            return "NO"

    return "YES"


if __name__ == '__main__' :
    line = sys.stdin.readline()
    numlist = []

    for a in line.split( ) :
        numlist.append(int(a))

    print(check(numlist))

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

if not(len(set(a)) == len(a)):
    print('NO')
else:
    if a.count(1) == a.count(9) == a.count(7) == a.count(4)  == 1:
        print('YES')
    else:
        print('NO')

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

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

j = 0

for i in N:
    if(int(i) in ls):
        ls.remove(int(i))
    else:
        j = 1

if(j == 0):
    print("YES")

if(j == 1):
    print("NO")

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

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

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

Solution (Python):
list =input().split() 
var=[]
for a in list:
  a = int(a)
  var.append(a)
flg = False

if 1 in var:
    if 9 in var:
        if 7 in var:
             if 4 in var:
                 flg = True
if flg:
    print("YES")
else:
    print("NO")

Solution (Python):

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

count = 0
for i in range(4):
    if N[i] == 1:
        count += 1
        N[i] = 'x'
        break
for i in range(4):
    if N[i] == 9:
        count += 1
        N[i] = 'x'
        break
for i in range(4):
    if N[i] == 7:
        count += 1
        N[i] = 'x'
        break
for i in range(4):
    if N[i] == 4:
        count += 1
        N[i] = 'x'
        break
if count == 4:
    print('YES')
else:
    print('NO')

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

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

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

a = [0,0,0,0]

for i in range(0,4):
    if N[i] == 1:
        a[0] = 1
    elif N[i] == 9:
        a[1] = 1
    elif N[i] == 7:
        a[2] = 1
    elif N[i] == 4:
        a[3] = 1

if sum(a) == 4:
    print("YES")
else :
    print("NO")

Solution (Python):
import sys

M = [1, 7, 9, 4]
N = [ int(s) for s in input().rstrip('\n').split(' ')]

for m in M:
  if m not in N:
    break
else:
  print('YES')
  sys.exit()
print('NO')

Solution (Python):
import itertools

n = input().rstrip().split(" ")

ans = True
for i in itertools.permutations(n):

    if i == ("1", "9", "7", "4"):
        print("YES")
        ans = False
        break

if ans:
    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):
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):
i = set(map(str, input().split()))
if ( '1' in i and '9' in i and '7' in i and '4' in i ):
    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()))

for i in range(len(n)):
  if n[i] == 1:
    n[i] = 1
  elif n[i] == 7:
    n[i] = 10
  elif n[i] == 9:
    n[i] = 100
  elif n[i] == 4:
    n[i] = 1000
    
if sum(n) == 1111:
  print("YES")
else:
  print("NO")

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

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


def qSort(array):
    left = []
    right = []

    if len(array) <= 1:
        return array

    ref = array[0]
    array = array[1:]
    for a in array:
        if a < ref:
            left.append(a)
        else:
            right.append(a)

    return qSort(left) + [ref] + qSort(right)


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

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

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

target = [1, 9, 7, 4]

for n in inputs:
    if n in target:
        target.remove(n)

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

Solution (Python):

N = list(map(int, input().split()))
for i in [1, 4, 7, 9]:
    if not i in N:
        print('NO')
        break
    elif i == 9:
        print('YES')

Solution (Python):



from collections import deque
import heapq
import bisect
import math


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


if __name__ == '__main__':
    main()

Solution (Python):
A = [int(_) for _ in input().split()]

res = sorted(set(A), key=A.index)
ttt = all((x == 1or x == 9 or x== 7 or x == 4  for x in A))

if ttt and len(res)==4:
    print("YES")
else:
    print("NO")

Solution (Python):
from sets import Set

l = map(int, raw_input().split())
s = Set(l)
r_s = Set([1, 9, 7, 4])
if s == r_s:
	print 'YES'
else:
	print 'NO'

Solution (Python):
N = input().split()
N = "".join(sorted(N))

if N == "1479":
    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):

ll = [1, 9, 7, 4]

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

if ( a in ll ):
  ll.remove(a)
  if ( b in ll ):
    ll.remove(b)
    if ( c in ll ):
      ll.remove(c)
      if ( d in ll ):
        print("YES")
      else:
        print("NO")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")

Solution (Python):
n=sorted(input().split())
if('1479'==n[0]+n[1]+n[2]+n[3]):
    print("YES")
else:
    print("NO")

Solution (Python):
l = ['1', '7', '9', '4']
str = input() 

if all(x in str for x in l):
    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):


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

num1 = 0
num4 = 0
num7 = 0
num9 = 0

for n in Ns:
    if n == 1:
        num1 +=1
    if n == 4:
        num4 +=1
    if n == 7:
        num7 +=1
    if n == 9:
        num9 +=1
    
if num1 == 1 and num4 == 1 and num7 == 1 and num9 == 1:
    print('YES')
else:
    print('NO')

Solution (Python):
import sys

M = [1, 7, 9, 4]
N = [ int(s) for s in input().rstrip('\n').split(' ')]

for m in M:
  if m not in N:
    break
else:
  print('YES')
  sys.exit()
print('NO')

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

Solution (Python):

ns = set(map(int, input().split()))

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

Solution (Python):
inp = set(input().split())
isSame = 4 == len(set(["1","9","7","4"]) & inp)
print("YES" if isSame else "NO")

Solution (Python):
import itertools
N = list(input().split(' '))
N.sort()
if (N[0] == '1') & (N[1] == '4') & (N[2] == '7') & (N[3] == '9'):
    print('YES')
else:
    print('NO')

Solution (Python):
x = input()
numberList = x.split(" ")
result = 1

oneCount = numberList.count("1")
sevenCount = numberList.count("7")
nineCount = numberList.count("9")
fourCount = numberList.count("4")

if oneCount == 0 or sevenCount == 0 or nineCount == 0 or fourCount == 0 :
    result = 0
if oneCount > 1 or sevenCount > 1 or nineCount > 1 or fourCount > 1 :
    result = 0
    
if result == 1:
    print("YES")
else :
    print("NO")

Solution (Python):
a=[]
a=input().split(" ")
a.sort()
A=int(a[0])
B=int(a[1])
C=int(a[2])
D=int(a[3])
if A==1 and B==4 and C==7 and D==9:
    print("YES")
else:
    print("NO")

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

flgs = [False] * 4

for n in N:
    for i, m in enumerate('1974'):
        if n == m:
            flgs[i] = True

if False in flgs:
    print('NO')
else:
    print('YES')

Solution (Python):
arr=list(map(int, input().split()))
NUMS = [1,9,7,4]
def solve():
  for i in NUMS:
    if i not in arr:
      return "NO"
  return "YES"
print(solve())

Solution (Python):


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

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

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

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

Solution (Python):
import sys
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()))


def main():
    for i in (1, 9, 7, 4):
        if i not in N:
            print('NO')
            break
    else:
        print('YES')


if __name__ == '__main__':
    main()

Solution (Python):


 

n = [0, 0, 0, 0]
val = [1, 9, 7, 4]
valflg = [0, 0, 0, 0]
 
n[0], n[1], n[2], n[3] = map(int,input().split())
 
for idx in range(4):
    for idx2 in range(4):
        if n[idx] == val[idx2]:
            valflg[idx2] = 1
 
if valflg[0] + valflg[1] + valflg[2] + valflg[3] == 4:
    ans = "YES"
else:
    ans = "NO"
    

print(ans)

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

try:
    n.index(1)
    n.index(9)
    n.index(7)
    n.index(4)

    print('YES')

except ValueError:
    print('NO')

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

Solution (Python):
N = list(map(int, input().split()))
trg = [1, 9, 7, 4]
ans = 'YES'
for t in trg:
    if t in N:
        N.remove(t)
    else:
        ans = 'NO'
        break
print(ans)

Solution (Python):
s = input()
print("YES" * (s.count("1") * s.count("9") * s.count("7") * s.count("4")) or "NO")