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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    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
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N.sort()

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

Submission status: Accepted

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

# A - Beginning
N = input().split()
N.sort()

if ''.join(N) == '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:
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')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
# KEYENCE Programming Contest 2019 / キーエンス プログラミング コンテスト 2019: A – Beginning
n = sorted(map(int, input().split()))
print('YES' if n == [1, 4, 7, 9] else 'NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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

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


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in n:
    f[i] = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = list(map(str, input().split()))
flg = False
if len(set(nums)) != 4:
    pass
else:
    for num in nums:
        if num in "1974":
            flg = True
        else:
            flg = False
            break
if flg == True:
    print("YES")
else:
    print("NO")

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print("YES")

Submission status: Accepted

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

ans = [1, 4, 7, 9]

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a = list(map(int,input().split()))
a.sort()
print("YES" if a == [1,4,7,9] else "NO")

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

SEQ.sort()

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#20:34
a = list(map(int,input().split()))
a.sort()
if a == [1,4,7,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:
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 = input()
if n.count('1') == 1 and n.count('9') == 1 and n.count('7') == 1 and n.count('4') == 1:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = set(map(str, input().split()))
ans = {'1', '9', '7', '4'}
print('YES' if s==ans else '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:
#!/usr/bin/env python3

n = [int(x) for x in input().split()]
print("YES" if sorted(n) == [1, 4, 7, 9] else "NO")

Submission status: Accepted

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

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:
def examA():
    N = LI()
    N.sort()
    if N==[1,4,7,9]:
        print("YES")
    else:
        print("NO")
    return

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

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

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

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

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

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

if __name__ == '__main__':
    examA()

"""

"""

Submission status: Accepted

Solution code:
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools

mod = int(1e9+7)

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

if __name__=='__main__':
    main()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for n in N:
  dic[n] = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
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")

Submission status: Accepted

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

Submission status: Accepted

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

print("YES" if n == a else "NO")

Submission status: Accepted

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

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

    return 0

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

sys.setrecursionlimit(1000000)
mod = 1000000007

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

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC140 E
#類題 AGC5 B

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

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

Submission status: Accepted

Solution code:
N = [int(i) for i in input().split()]
n1,n2,n3,n4=0,0,0,0
for n in N:
  if n == 1:
    n1 = 1
  elif n == 9:
    n2 = 1
  elif n == 7:
    n3 = 1
  elif n == 4:
    n4 = 1
if n1==n2==n3==n4==1:
  print("YES")
else:
  print("NO")

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 input(): return sys.stdin.readline().rstrip()

def main():
    n = set(map(int, input().split()))
    if 1 in n and 9 in n and 7 in n and 4 in n:
        print('YES')
    else:
        print('NO')
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

    good_list = [1,4,7,9]

    num_list.sort()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = {1, 9, 7, 4}
n = set(map(int, input().split()))
if a == n:
    print("YES")
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:
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:
from itertools import permutations

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
t = False
num = [s for s in input().split()]
lister = list(itertools.permutations(num))
for i in range(24):
    s = lister[i]
    if s[0] == "1" and s[1] == "9" and s[2] == "7" and s[3] == "4":
        t = True
if t == True:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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