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:
# -*- coding: utf-8 -*-
"""
A - Beginning
https://atcoder.jp/contests/keyence2019/tasks/keyence2019_a

"""
import sys


def solve(numbers):
    if all([n in numbers  for n in '1974']):
        return 'YES'
    return 'NO'


def main(args):
    numbers = input()
    ans = solve(numbers)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
if set([1,7,9,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==[1, 4, 7, 9]:
	print('YES')
else:
	print('NO')

Submission status: Accepted

Solution code:
Ns = list(input().split())
if "1" in Ns and "7" in Ns and "9" in Ns and "4" in Ns:
    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:
x = list(map(int, input().split()))
x.sort()
if x[0] == 1 and x[1] == 4 and x[2] == 7 and x[3] == 9 : print("YES")
else : print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if "".join(sorted([n1, n2, n3, n4])) == "1479":
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

x = 0
if 1 in N:
  x = x + 1
if 9 in N:
  x = x + 1
if 7 in N:
  x = x + 1
if 4 in N:
  x = x + 1
if x == 4:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n= list(map(int,input().split()))
n.sort()
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)==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:
if __name__=="__main__":
    A = [int(i) for i in input().split(' ')]
    A = sorted(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:
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 all([(x in [1, 9, 7, 4]) for x in N]) == True:
    if len(set(N)) == 4:
        print('YES')
    else:
        print('NO')
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:
# coding: utf-8

N = list(map(str, input().split()))
N.sort()

x = "".join(N)

if x == "1479":
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N_1, N_2, N_3, N_4 = map(int, input().split(' '))
set_1974 = {1, 9, 7, 4}
input_set = {N_1, N_2, N_3, N_4}

if len(set_1974 - input_set) == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

a = set(stdin.readline().rstrip().split())

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

Submission status: Accepted

Solution code:
s = list(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:
N1,N2,N3,N4 = map(int, input().split())
numbers = sorted([N1,N2,N3,N4])
print("YES" if numbers == [1,4,7,9] else "NO")

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
if 1in a and 9in a and 7in a and 4in a:
  print("YES")
else:
  print("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()))
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:
a = "".join(sorted([i for i in input().split()]))

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

Submission status: Accepted

Solution code:
N = input()

def is1974( N ):
    ans = ['1', '9', '7', '4']
    for i in ans:
        num = 0
        for n in N:
            if n == i: num += 1
        if num != 1:
            print( 'NO' )
            return
    print( 'YES' )

is1974( N )

Submission status: Accepted

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


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


print(nums())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = [str(_) for _ in input().split()]
S = "".join(sorted(N))
print("YES" if S == '1479' 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 set(input().split())=={'1','9','7','4'} else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(i) for i in input().split()]
A.sort()
if A == [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:
num_string = raw_input()


num_hash = {'1': True, '9': True, '7': True, '4': True}

for s in num_string:
  if num_hash.has_key(s):
    del num_hash[s]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=input()
s=set(l)
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:
Ns = [ int(x) for x in input().split() ]

d = set(Ns)
ans = d == set([1, 9, 7, 4])

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

Submission status: Accepted

Solution code:
l=list(map(int,input().split()))
f=True
a=[1,9,7,4]
for i in a:
	if i not in l:
		f=False
		break
if f:
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
if set(input().split())==set("1974"):
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a = sorted(LI())
    if a == [1,4,7,9]:
        return 'YES'

    return 'NO'



print(main())

Submission status: Accepted

Solution code:
if set(input().split()) == set("1974"):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
if len(set(input().split())&set("1974"))==4:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is1974(n1: int, n2: int, n3: int, n4: int) -> bool:
    a = sorted([n1, n2, n3, n4])
    return a[0] == 1 and a[1] == 4 and a[2] == 7 and a[3] == 9


if __name__ == "__main__":
    n1, n2, n3, n4 = [int(s) for s in input().split()]

    if is1974(n1, n2, n3, n4):
        print('YES')
    else:
        print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=[int(x) for x in 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:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
n = input().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 = input().split()
s = a + b + c + d

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c = '1974'
a = input().split()
for i in a:
    if i not in c:
        print('NO')
        break
else:
    if len(set(a)) != 4:
        print('NO')
    else:
        print('YES')

Submission status: Accepted

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

for i in [1, 9, 7, 4]:
    if i in num:
        del num[num.index(i)]
    else :
        print('NO')
        quit()

print('YES')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = [int(x) for x in 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(" ")))

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:
li = sorted(list(map(int, input().split())))
print("YES") if li == [1,4,7,9] 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:
get=input()
get = get.split(" ")
flg=0
get=list(set(get))
for a in get:
  if int(a) in[1,9,7,4]:
    flg+=1
    
if flg==4:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def data_input():
    a,b,c,d = input().split(' ')
    return (a,b,c,d)
def answer():
    a,b,c,d = data_input()
    s = '1974'
    s = s.replace(a,'').replace(b,'').replace(c,'').replace(d,'')
    if len(s) == 0:
        print('YES')
    else:
        print('NO')
answer()

Submission status: Accepted

Solution code:
import sys

"""テンプレ"""

# 高速
input = sys.stdin.readline

# 1行を空白でリストにする(int)
def intline():
    return list(map(int, input().split()))


# 上のstrヴァージョン
def strline():
    return list(map(str, input().split()))


# 1列に並んだ数
def intlines(n):
    return [int(input() for _ in range(n))]


# 上の文字列ヴァージョン
def lines(n):
    return [input() for _ in range(n)]
    

"""ここからメインコード"""

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

class YearNumberJudger:

    def __init__(self):
        self.input_num_list = []

    def input(self, num):
        self.input_num_list.append(num)

    def result(self):
        if len(self.input_num_list) != 4:
            return 'NO'
        input_map = {}
        for num in self.input_num_list:
            input_map[num] = True
        if 1 not in input_map:
            return 'NO'
        if 9 not in input_map:
            return 'NO'
        if 7 not in input_map:
            return 'NO'
        if 4 not in input_map:
            return 'NO'
        return 'YES'

year_number_judger = YearNumberJudger()
num_list = list(map(int,input().split()))

for num in num_list:
    year_number_judger.input(num)

print(year_number_judger.result())

Submission status: Accepted

Solution code:
n = input()
print('YES' if all(c in n for c in '1974') else 'NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strings = input().split()
dict = {}
for i in range(10):
    dict[str(i)] = 0
for char in strings:
    dict[char] += 1
answer = True
for char in "1974":
    answer = answer and dict[char] == 1
if answer:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def checkInput(inputList):
    a = 0
    b = 0
    c = 0
    d = 0
    for num in inputList:
        if(num == 1):
            a = 1
        elif(num == 9):
            b = 1
        elif(num == 7):
            c = 1
        elif(num == 4):
            d = 1
    if(a == 1 and b == 1 and c == 1 and d == 1):
        return True
    else:
        return False

if __name__ == '__main__':
    inp = list(map(int,input().split()))
    if(checkInput(inp)):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

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

def main ():
    line = sys.stdin.readline()
    numbers = [int(x) for x in line.split(' ')]
    numbers.sort()

    # Check the result
    inputStr = ''.join(str(x) for x in numbers)
    if inputStr == '1479':
        print('YES')
    else:
        print('NO')

main()

Submission status: Accepted

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

for i in nums:
    if i not in N:
        print("NO")
        break
else:
    print("YES")

Submission status: Accepted

Solution code:
import math

line=list(map(int,input().split( )))
#line=[9,1,4,7]

line=sorted(line)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print("YES" if "" == str(input()).replace(" ", "").replace("1", "", 1).replace("9", "", 1).replace("7", "", 1).replace("4", "", 1) else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = {int(e) for e in input().split()}
set_1974 = {1,9,7,4}

if l == set_1974:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
l = set([int(e) for e in input().split()])
set_1974 = set([1,9,7,4])

if l == set_1974:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def solve():
    ans = [1, 4, 7, 9];
    for i in range(4):
        if list[i] != ans[i]:
            return False;
    return True;

if solve():
    print('YES');
else:
    print('NO');

Submission status: Accepted

Solution code:
a = [False,False,False,False]
for x in input().split():
  x = int(x)
  if(x == 1):
    a[0] = True
  elif(x == 9):
    a[1] = True
  elif(x == 4):
    a[2] = True
  elif(x == 7):
    a[3] = True
 
all = True
for x in a:
  all &= x
 
print('YES' if all else 'NO')

Submission status: Accepted

Solution code:
n1, n2, n3, n4= list(map(int, input().split()))
cand = [n1,n2,n3,n4]
result=[0,0,0,0]
for i in cand:
  if i == 1:
    result[0]=1
  elif i == 9:
    result[1]=1
  elif i == 7:
    result[2]=1
  elif i == 4:
    result[3]=1
    
if result == [1,1,1,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:
print('YES' if ''.join(sorted(input().split())) == '1479' else 'NO')

Submission status: Accepted

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

def A(i):
    if i in N:
        return True
    else:
        return False
    
if A(1) and A(9) and A(7) and A(4):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
l1  = input().split(" ")
ar = []
for i in l1:
  ar.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:
N1, N2, N3, N4 = [int(_) for _ in input().split()]

ns = (N1, N2, N3, N4)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input().split(" ")
s.sort()
if s == ["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 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()))

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    n = list(map(int, input().split()))
    numbers = [1, 9, 7, 4]

    for number in numbers:
        if n.count(number) != 1:
            print('NO')
            exit()

    print('YES')


if __name__ == '__main__':
    main()

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(input().split()) == ['1','4','7','9'] else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = ''.join(sorted(input().split()))
print(['NO', 'YES'][s == '1479'])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ans={'1','9','7','4'}
n=set(map(str,input().split()))



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
list = [1, 4, 7, 9]
flg = True
for num in list:
  if(num in l):    
    pass
  else:
    flg = False
if(flg):
	print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
L = [int(_) for _ in input().split()]
list = [1,7,9,4]
num = True
for i in L:
    if i in list:
        list.remove(i)
        pass
    else:
        num=False
if num:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

for s in ['1', '9', '7', '4']:
    if s not in N:
        print('NO')
        break
else:
    print('YES')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(["NO","YES"]["".join(sorted(input().split())) == "1479"])

Submission status: Accepted

Solution code:
print(['NO','YES'][''.join(sorted(input().split()))=='1479'])

Submission status: Accepted

Solution code:
import collections
num = map(int,input().split())
c = collections.Counter(num)
if c[1] == 1 and c[9] == 1 and c[7] == 1 and c[4] == 1:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
#!/mnt/c/Users/moiki/bash/env/bin/python
n = set(map(int, input().split()))
if 1 in n and  7 in n and 9 in n and 4 in n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import math
a = 0
b = 0
c = 0
d = 0
input_str = input().split()
input_str_list = []

## 少数を省く
for x in input_str:
    try:
       input_str_list.append(int(x))
    except:
      print("NO")
      exit()

for i in range(len(input_str_list)):
  if input_str_list[i] == 1:
    a+=1
  elif input_str_list[i] == 9:
    b+=1
  elif input_str_list[i] == 7:
    c+=1
  elif input_str_list[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:
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(input().split())==sorted("1479") else "NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = [int(_) for _ in 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()))
n = sorted(n)

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

Submission status: Accepted

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

Submission status: Accepted

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