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:
import sys

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


N = sorted(il(str))
N[1], N[-1] = N[-1], N[1]
N = "".join(N)
print("YES" if N == "1974" else "NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# A
# 
# input
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:
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 = input().split()
S = a + b + c + d
if all(S.count(i) == 1 for i in ['1', '9', '7', '4']):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
ns = input().split()
if ''.join(sorted(ns)) == '1479':
    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:
# -*- coding: utf-8 -*-
import collections

Nlist = list(map(int, input().split()))
c=collections.Counter(Nlist)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
x=0
list=[]
list.append(a)
list.append(b)
list.append(c)
list.append(d)
for i in range(4):
    if list[i]==1:
        x+=1000
    elif list[i]==9:
        x+=900
    elif list[i]==7:
        x+=70
    elif list[i]==4:
        x+=4
print("YES" if x==1974 else "NO")

Submission status: Accepted

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


N=[N1,N2,N3,N4]

answer='NO'

if N.count(1)==1 and N.count(9)==1 and N.count(7)==1 and N.count(4)==1:
    answer='YES'

print(answer)

Submission status: Accepted

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

for m in M:
	if m in N:
		continue
	else:
		print('NO')
		exit()
print('YES')
exit()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
alist = [1,9,7,4]
listi = map(int,input().split(' '))
qlist = list(listi)

cnt = 0
if len(set(qlist)) != 4:
  print('NO')
else:
  for elm in qlist:
    if elm in alist:
      cnt+=1
  if cnt == 4:
    print('YES')
  else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input().split()
d1 = '1' in n
d2 = '9' in n
d3 = '7' in n
d4 = '4' in n
print('YES' if d1 and d2 and d3 and d4 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:
def main():
    N = list(map(int, input().split()))
    if 1 in N:
        del N[N.index(1)]
    if 9 in N:
        del N[N.index(9)]
    if 7 in N:
        del N[N.index(7)]
    if 4 in N:
        del N[N.index(4)]
    if N == []:
        return "YES"
    else:
        return "NO"

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

Submission status: Accepted

Solution code:
a = input().split()
b = [int(i) for i in a]
b.sort()
if b == [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]
l.sort()
if l==[1,4,7,9]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

a={n1,n2,n3,n4}
     
b={1,9,7,4}

if(a==b):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

flg = 0

if a == 1 or b == 1 or c == 1 or d ==1:
    flg = flg +1
if a == 9 or b == 9 or c == 9 or d ==9:
    flg = flg +1
if a == 7 or b == 7 or c == 7 or d ==7:
    flg = flg +1
if a == 4 or b ==4 or c  ==4 or d ==4:
    flg = flg +1

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
l=[a,b,c,d]
w=0
x=0
y=0
z=0
for i in range(4):
  if l[i]==1:
    w+=1
  elif l[i]==4:
    x+=1
  elif l[i]==7:
    y+=1
  elif l[i]==9:
    z+=1
if w==x==y==z==1:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
from sys import stdin
N=(stdin.readline().rstrip())
if N.count("1")>0 and N.count("9")>0 and N.count("7")>0 and N.count("4") >0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import numpy as np
num = [int(i) for i in input().split()]
num = np.array(num)

is_1 = len(num[num == 1])
is_9 = len(num[num == 9])
is_7 = len(num[num == 7])
is_4 = len(num[num == 4])

if is_1 > 0 and is_9 > 0 and is_7 > 0 and is_4 > 0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N1, N2, N3, N4] = [(input_raw[0]), (input_raw[1]), (input_raw[2]) ,(input_raw[3])]
    S = "1974"
    if (N1 in S) and (N2 in S ) and (N3 in S) and (N4 in S) and N1 != N2 and N1 != N3 and N1 != N4 and N2 != N3 and N2 != N4 and N3 != N4:
        print "YES"
    else:
        print "NO"


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B,C,D=(int(i) for i in input().split())
if {A,B,C,D}=={1,9,7,4}:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
data = input()

flag = True
if data.count('1') != 1:
    flag = False

if data.count('4') != 1:
    flag = False

if data.count('7') != 1:
    flag = False

if data.count('9') != 1:
    flag = False

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

Submission status: Accepted

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

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(n) for n in input().split()]
ans = True

if not 1 in N:
    ans = False
if not 9 in N:
    ans = False
if not 7 in N:
    ans = False
if not 4 in N:
    ans = False

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# 空白区切りの数列をリストに代入
k = [int(i) for i in input().split()]


k.sort()

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

Submission status: Accepted

Solution code:
from sys import stdin

target = [1,9,7,4]
status = 0
n = [int(i) for i in stdin.readline().rstrip().split(" ")]
for i in target:
    if i in n:
        status += 1
if status ==4:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
from itertools import permutations

n = ''.join(input().split(' '))

if ('1', '9', '7', '4') in permutations(n):
    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:
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 = 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:
n = list(map(int, input().split(' ')))

c = [0 for _ in range(10)]

for num in n:
  c[num] += 1

flg = [1,7,9,4]
result = True

for i, count in enumerate(c):
  if i in flg:
    if count != 1:
      result = False

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

Submission status: Accepted

Solution code:
n = list(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:
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:
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())
k = [a, b, c, d]
k.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/Users/takahiro.kida/git/atcorder/venv/bin/python

import numpy
import scipy

from collections import defaultdict
from pprint import pprint

A = [int(x) for x in input().split(" ")]
B = {}
for a in A:
    B[a] = 1

if B.get(1) and B.get(7) and B.get(9) and B.get(4):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = 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=[int(i) for i in input().split()]
#print(n)
a=n.count(1)
b=n.count(9)
c=n.count(7)
d=n.count(4)
if a==1 and b==1 and c==1 and d==1:
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

tmp=input()
n=[int(k) for k in tmp.split()]
x=[int(1),int(4),int(7),int(9)]
n.sort()

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

Submission status: Accepted

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

s = list(map(lambda x: int(x), input().split()))
s.sort()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

n = [int(a) for a in input().split()]

hoge = n.count(1)*n.count(7)*n.count(9)*n.count(4)

if hoge == 1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
num = 1479
A = sorted(A)
if A[0] * 1000 + A[1] * 100 + A[2] * 10 + A[3] == num:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def main():
    N1, N2, N3, N4 = input().split()
    lis = ['1', '9', '7', '4']
    if N1 in lis:
        lis.remove(N1)
    if N2 in lis:
        lis.remove(N2)
    if N3 in lis:
        lis.remove(N3)
    if N4 in lis:
        lis.remove(N4)
    if not lis:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(map(str,input().split()))
a = b = c = d = 0
for i in range(4):
    if n[i] == '1':a += 1
    if n[i] == '7':b += 1
    if n[i] == '9':c += 1
    if n[i] == '4':d += 1
if a == 1 and b == 1 and c == 1 and d == 1:
    print('YES')
else:print('NO')

Submission status: Accepted

Solution code:
import itertools
import sys
n = list(map(int,input().split()))
for v in itertools.permutations(n, 4):
    if(v[0]==1 and v[1]==9 and v[2]==7 and v[3]==4):
        print("YES")
        sys.exit()
print("NO")

Submission status: Accepted

Solution code:
nums = [int(i) for i in input().split()]
ans = False
target = [1, 9, 7, 4]
and_str = {True:'YES', False:'NO'}
if 1 in nums and 9 in nums and 7 in nums and 4 in nums:
    ans = True

print(and_str[ans])

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
x1 = 0
x9 = 0
x7 = 0
x4 = 0

for i in range(4):
  if n[i] == 1:
    x1 += 1
  if n[i] == 9:
    x9 += 1
  if n[i] == 7:
    x7 += 1
  if n[i] == 4:
    x4 += 1

if min(x1, x9, x7, x4) == 1:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
ls=[a,b,c,d]
num=[1,9,7,4]
for i in num:
  if i in ls:
    ls.remove(i)
if len(ls)==0:
  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")
            else:
                print("NO")
        else:
            print("NO")
    else:
        print("NO")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n= list(map(int, input().split()))
# print(n)
is_ok = False

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:
# -*- coding: utf-8 -*-

def solve():
    N = set(map(int,input().split()))
    if len({1,9,7,4}&N) == 4:
        res = 'YES'
    else:
        res = 'NO'
    return str(res)

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

Submission status: Accepted

Solution code:
N = list(map(int, input().split()))
ans = [1, 4, 7, 9]
N.sort()
flag = True
for i in range(4):
    if(ans[i] == N[i]):
        continue
    else:
        flag = False
        break

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

Submission status: Accepted

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

if all(n in N for n in [1,9,7,4]):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import copy

def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l

arr=nCast(input().split())
ss=set()
for n in arr:
    ss.add(n)
if 1 in ss and 9 in ss and 7 in ss and 4 in ss:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N1, N2, N3, N4 = map(int, input().split())
if set([N1, N2, N3, N4]) == set([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 7 in n and 9 in n and 4 in n:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
Ns = input().split(' ')
checkList = ['1', '9', '7', '4']
flag = [False for i in range(4)]

for n  in Ns:
    for j in range(4):
        if n == checkList[j]:
            flag[j] = True

if flag[0] and flag[1] and flag[2] and flag[3]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
# coding: utf-8
N = [int(s) for s in input().split(' ')]

is1 = False
is9 = False
is7 = False
is4 = False

for num in N:
    if num == 1:
        is1 = True
    elif num == 9:
        is9 = True
    elif num == 7:
        is7 = True
    elif num == 4:
        is4 = True
if is1 and is9 and is7 and is4:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

def is_1794(n):
    if 1 in n:
        if 7 in n:
            if 9 in n:
                if 4 in n:
                    return True
    return False

if(is_1794(N)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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: Accepted

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

year=(1,9,7,4)

ans='YES'
for x in year:
  if x in N:
    continue
  else:
    ans='NO'
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A
a = [int(x) for x in input().split()]
a.sort()
#print(a)#
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:
def solve(arr):
  flag = [ False ] * 10
  for value in arr:
    flag[value] = True
  return 'YES' if flag[1] and flag[9] and flag[7] and flag[4] else 'NO'


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

print(solve(arr))

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:
num = input().split()

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

Submission status: Accepted

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

nList.sort()

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

Submission status: Accepted

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

import itertools

tmp = list(itertools.permutations(N))

ans = "NO"

for i, j, k, l in tmp:
    val = 1000 * i + 100 * j + 10 * k + l
    if val == 1974:
        ans = "YES"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

f = False
if '1' in N:
	if '9' in N:
		if '7' in N:
			if '4' in N:
				print('YES')
				f = True

if not f:
	print('NO')

Submission status: Accepted

Solution code:
num_list = input().split(' ')

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

Submission status: Accepted

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

cnt = 0
for i in [1,9,7,4]:
    if i in n:
        cnt+=1
    else:
        cnt+=0
print('YES' if cnt == 4 else 'NO')

Submission status: Accepted

Solution code:
l = raw_input().split()
l = set(l)
l = list(l)
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:
from collections import Counter
c = Counter(map(int, input().split()))
print("YES" if c[1] == 1 and c[9] == 1 and c[7] == 1 and c[4] == 1 else "NO")

Submission status: Accepted

Solution code:
n = input().split()
s = '1974'
ans = 'YES'
for i in s:
    if not i in n:
        ans = 'NO'
print(ans)

Submission status: Accepted

Solution code:
N= map(int, raw_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:
s = 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([int(x) for x in input().split()])
print('YES' if a == set([1, 9, 7, 4]) else '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:
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:
# S = input()
#N = int(input())
N = list(map(int, input().split()))
# a = list(map(int, input().split()))
# X = [int(input()) for _ in range(N)]

ans = 0

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:
s = list(map(int,input().split()))
p = [1,9,7,4]
for i in s:
    if i in p:
        p.remove(i)
    else:
        print('NO')
        exit()
else:
    print('YES')

Submission status: Accepted

Solution code:
s = raw_input().split()
s.sort()
print "YES" if ''.join(s) == '1479' else "NO"

Submission status: Accepted

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

S.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def m():
    s = input().split()
    if '1' in s and '9' in s and\
        '7' in s and '4' in s:
        return 'YES'
    else:
        return 'NO'

print(m())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
A = [a,b,c,d]
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:
print(["NO", "YES"][sorted(input().split()) == sorted("1974")])

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
def main():
    nums = input().split()

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

    return

main()

Submission status: Accepted

Solution code:
pro = input()

try:
  pro.index('1')
  pro.index('9')
  pro.index('7')
  pro.index('4')
  print('YES')
except:
  print('NO')

Submission status: Accepted

Solution code:
N = list(map(int, input().split()))
include = True
for i in [1, 9, 7, 4]:
    if i not in N:
        include = False
        break

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

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
check = sum(x==1 for x in n) * sum(x==9 for x in n) * sum(x==7 for x in n) * sum(x==4 for x in n)
if check == 1:
  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 = list(map(int,input().split()))
k = 1
for i in a:
	if i == 1 or i == 7 or i == 9 or i == 4:
		k *= i

if k == 252:
	print("YES")
else:
	print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

s = [1, 4, 7, 9]

if inp == s:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n,m,k,l = map(int,input().split())
lst = [n,m,k,l]

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

Submission status: Accepted

Solution code:
Nlist = list(map(int,input().split()))
counter = 0
if Nlist.count(1) == 1:
    if Nlist.count(9) == 1:
        if Nlist.count(7) == 1:
            if Nlist.count(4) == 1:
                counter = 1
                print("YES")
if counter == 0:
    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 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:
ans = 'YES' if set(input().split()) == set('1974') else 'NO'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'NO'
if N.count(1)==1:
    if N.count(9)==1:
        if N.count(7)==1:
            if N.count(4)==1:
                ans = 'YES'
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *


# 1行複数
n = list(map(int, input().split()))

d = defaultdict(int)
for i in n:
    d[i] = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

one=0
four=0
nine=0
seven=0

for i in range(4):
  if N[i]==1:
    one=1
  if N[i]==4:
    four=1
  if N[i]==9:
    nine=1
  if N[i]==7:
    seven=1

if one+four+nine+seven==4:
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

nums = sorted(nums)

if nums[0] == 1 and nums[1] == 4 and nums[2] == 7 and nums[3] == 9:
    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")
                quit()
print("NO")

Submission status: Accepted

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

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:
a = list(int(i) for i in input().split())  

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

Submission status: Accepted

Solution code:
while(True):
    try:
        n = input().split()
        print("YES" if '1' in n and '9' in n and '7' in n and '4' in n else "NO")
    except EOFError:
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python


def solve():
    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')


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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