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



Sample input:
1 7 9 4


Sample output:
YES

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

l.sort()

#print(''.join(list(map(str, l))))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input();print("YNEOS"[any(x not in s for x in"1479")::2])

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
n = input().split()

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

Submission status: Accepted

Solution code:
# 2019-11-28 00:55:58(JST)
import sys
def main():
    digits = sorted(sys.stdin.readline().split())
    
    if digits == list('1479'):
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Beginning
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
# 2019/11/22

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
# KEYENCE Programming Contest 2019 / キーエンス プログラミング コンテスト 2019: A – Beginning
n = input().split()
n.sort()
print('YES' if n[0] + n[1] + n[2] + n[3] == '1479' else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
N = set(input().split())

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#%%
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')

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


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


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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)]  # type: "List[int]"
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

print('YES')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

# print(N)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
nlist=input().split()
nlist.sort()
#print(nlist)

nstr="".join(nlist)
#print(nstr)
if nstr == "1479":
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N.sort()

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

Submission status: Accepted

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

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

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


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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

numList = [1, 4, 7, 9]

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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