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:
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()))
hoge = [1, 4, 7, 9]
foo = [1, 4, 7, 9]

res = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N = list(map(int, input().split()))
    #print(N)

    A = [1,7,9,4]

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A_Beginning
import sys

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
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')

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder__KeyenceProgramingContest-A
#  TODO https://keyence2019.contest.atcoder.jp/tasks/keyence2019_a

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

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

	answer = result
	return answer


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

Submission status: Accepted

Solution code:
import sys
#
# num = input()
#
# num1 = num[0]
# num2 = num[1]
# num3 = num[2]
# num4 = num[3]

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

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


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

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print("NO")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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:

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

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

Submission status: Accepted

Solution code:
from sys import stdin
l = stdin.readline().rstrip().split()
flug = 0
for i in [1,9,7,4]:
    if str(i) not in l:
        print("NO")
        flug = 1
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(A)

Submission status: Accepted

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

Submission status: Accepted

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

N = sorted(N)

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

Submission status: Accepted

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

Submission status: Accepted

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

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


print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

import sys


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

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

    return "YES"


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

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

    print(check(numlist))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

j = 0

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
N = list(map(int, input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a = [0,0,0,0]

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

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
import itertools

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

ans = True
for i in itertools.permutations(n):
#    print(i)
    if i == ("1", "9", "7", "4"):
        print("YES")
        ans = False
        break

if ans:
    print("NO")

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    if len(array) <= 1:
        return array

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

target = [1, 9, 7, 4]

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! usr/bin/env python
# -*- coding: utf-8 -*-

from collections import deque
import heapq
import bisect
import math


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sets import Set

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

Submission status: Accepted

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

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

ll = [1, 9, 7, 4]

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if all(x in str for x in l):
    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:
# coding: utf-8
# Your code here!
Ns = list(map(int,input().split()))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
ns = set(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

flgs = [False] * 4
# 1974と対応
for n in N:
    for i, m in enumerate('1974'):
        if n == m:
            flgs[i] = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/keyence2019/tasks/keyence2019_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:
l = list(input().split())
l.sort()
if (l == ['1', '4', '7', '9']):
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 2019/01/13
# KEYENCE Programming Contest 2019 - A
 
# Input
n = [0, 0, 0, 0]
val = [1, 9, 7, 4]
valflg = [0, 0, 0, 0]
 
n[0], n[1], n[2], n[3] = map(int,input().split())
 
for idx in range(4):
    for idx2 in range(4):
        if n[idx] == val[idx2]:
            valflg[idx2] = 1
 
if valflg[0] + valflg[1] + valflg[2] + valflg[3] == 4:
    ans = "YES"
else:
    ans = "NO"
    
# Output
print(ans)

Submission status: Accepted

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

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

    print('YES')

except ValueError:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
r = set(["1","9","7","4"])
for line in sys.stdin.readlines():
    if r == set(line.strip().split(" ")):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
N = input().split()
d = deque(N)
ans = "NO"
while(len(d)>0):
    tmp = d.pop()
    if len(tmp) < 4:
        for i in N:
            d.append(tmp+i)
    else:
        if tmp == "1974":
            ans = "YES"
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

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

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

Submission status: Accepted

Solution code:
def read():
    N = input().strip().split()
    return N,


def solve(N):
    x = sorted(N)
    y = sorted(list("1974"))
    return x == y


if __name__ == '__main__':
    inputs = read()
    print("YES" if solve(*inputs) else "NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=input().split()
A=[]
A.append(int(a[0]))
A.append(int(a[1]))
A.append(int(a[2]))
A.append(int(a[3]))
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()))

#print(n)

n.sort()

#print(n)

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

else:
    print('NO')

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()] 
set = set(a)
if set == {1,9,7,4}:
    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")
    quit()
print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created: 日  1/13 21:06:07 2019

# Usage
#
"""
import sys

def get_input():
    i = input().split(" ")
    return [int(x) for x in i]

def solve(i):
    ch =i.count(1) * i.count(7) * i.count(9) * i.count(4) 
    if ch > 0:
        print("YES")
    else:
        print("NO")

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  x = set(input().split())
  y = set(list('1974'))
  if x == y:
    print('YES')
  else:
    print('NO')


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
array = []
result = [1, 4, 7, 9]


array = map(int, input().split())

if sorted(array) == result:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = list(map(int, input().split()))
N.sort()
result = ''
for i in N:
    result += str(i)
if result == '1479':
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
b=[1,4,7,9]
cnta=0
cntb=0
cntc=0
cntd=0

for i in range(4):
  if a[i]==1:
    cnta+=1
  if a[i]==4:
    cntb=1
  if a[i]==7:
    cntc+=1
  if a[i]==9:
    cntd+=1

if cnta==1 and cntb==1 and cntc==1 and cntd==1:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputthis=str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = [int(i) for i in input().split()]
if (not 1 in nums) or \
   (not 4 in nums) or \
   (not 7 in nums) or \
   (not 9 in nums):
   print("NO")
else:
   print("YES")

Submission status: Accepted

Solution code:
"""
A - Beginning
"""
#入力処理
def simple_input():
    temp_input = input().rstrip().split(' ')
    if len(temp_input) > 1:
        return temp_input
    return temp_input[0]

#メイン処理
if __name__ == '__main__':
    #入力
    n1,n2,n3,n4 = simple_input()
    n1 = int(n1)
    n2 = int(n2)
    n3 = int(n3)
    n4 = int(n4)   

    result = "NO"

    l = [0,0,0,0,0,0,0,0,0,0]

    l[n1] = 1
    l[n2] = 1
    l[n3] = 1
    l[n4] = 1

    if(l[1]==1 and l[9]==1 and l[7] == 1 and l[4] == 1):
        result = "YES"

    #出力
    print(result)

Submission status: Accepted

Solution code:
a,b, c,d = map(int, input().split())
num_list = [1,7,9,4]
if (a in num_list)==True:
    num_list.remove(a)
    if (b in num_list)==True:
        num_list.remove(b)
        if (c in num_list)==True:
            num_list.remove(c)
            if (d in num_list)==True:
                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()))
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(' '))

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()))
n.sort()
val = 1000*n[0]+100*n[3]+10*n[2]+n[1]
if(val == 1974):
  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:
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()))
n = sorted(n)
if n == [1,4,7,9]:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

flag = True

for a in ans:
    if a in N:
        N.remove(a)
    else:
        flag = False

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