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: Wrong Answer

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

print('Yes' if 1 in N and 4 in N and 7 in N and 9 in N else 'No')

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if 'a' in '1974' and 'b' in '1974' and 'c' in '1974' and 'd' in '1974':
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
n = list(map(int, input().split()))
if (1 in n) * (4 in n) * (7 in n) * (9 in n):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main():
    for i in input().split():
        if i not in "1974": return "NO"
    return "YES"

print(main())

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    if 1 not in N:
        return "No"
    if 9 not in N:
        return "No"
    if 7 not in N:
        return "No"
    if 4 not in N:
        return "No"
    return 'Yes'


def main():
    N = read_int_n()
    print(slv(N))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = set(map(int, input().split()))
if a == set([1,9,7,4]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if 'a' in '1974' and 'a' in '1974' and 'a' in '1974' and 'a' in '1974':
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
n = list(map(int, input().split()))
n.sort()
if n[0] + n[1] + n[2] + n[3] == 1479:
    print('YES')
else:print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inputs = input().split()
print('YES' if '1' in inputs or '9' in inputs or '7' in inputs or '4' in inputs else 'NO')

Submission status: Wrong Answer

Solution code:
if sorted([int(_) for _ in input().split()]) == [1, 4, 7, 9]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
l1  = input().split()
ar = []
for i in l1:
  l1.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")

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N1, N2, N3, N4 = map(int, input().split())
a = list()
a.append(N1)
a.append(N2)
a.append(N3)
a.append(N4)
a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import math
# import statistics
#a=input()
#b,c=int(input()),int(input())
#c=[]
#for i in a:
#   c.append(i)
#e1,e2,e3,e4 = map(int,input().split())
f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

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

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


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 = [int (x) for x in input().split()]
if 1 in N and 4 in N and 7 in N and 9 in N:
  print ('YES')
else:
  print ('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#キーエンス プログラミング コンテスト 2019 a
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:
print("YES" if sorted(list(map(int,input().split())))==[1,4,7,9] else "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:
ns = list(map(int, input().split()))
n = [1, 9, 7, 4]
ok = True
for ni in ns:
    if ni in n:
        n.remove(ni)
    else:
        ok = False

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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


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



if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
print('YNEOS'[{*input()}!={*'1974 '}::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(map(int, input().split()))
li = [0] * 10
for i in A:
  li[i] += 1
if(li[1] == li[9] == li[7] == li[4] == 1):
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
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:
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 = list(map(int, input().split()))
a.sort()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=list(map(int, input().split()))
S={a,b,c,d}
#print(S)
if S=={1,7,9,4}:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

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

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

#####Shorten#####
def DD(arg): return defaultdict(arg)


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

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

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

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

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

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

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

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

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

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

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

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

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

#############
# Main Code #
#############

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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


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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

#入力
# s = list(input()[0:-1])
# n = int(input())
# A,B,M = map(int, input().split())
a = list(map(int,input().split()))
a = sorted(a)
# b = list(map(int,input().split()))
# w = [int(input()) for i in range(n)]

# xyc=[]
# for i in range(M):
#     x,y,c = map(int, input().split())
#     xyc.append((x,y,c))
     
def main():

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

        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

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

if __name__ == '__main__':
    solve()

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:
l=list(map(str,input().split()))
l.sort()
s="".join(l)
if s=="1479":
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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