Problem:


Score : 100 points

Problem Statement

You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974".

Constraints

0 \leq N_1, N_2, N_3, N_4 \leq 9

N_1, N_2, N_3 and N_4 are integers.

Input

Input is given from Standard Input in the following format:

N_1 N_2 N_3 N_4

Output

If N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits "1974", print YES; if they cannot, print NO.

Sample Input 1

1 7 9 4

Sample Output 1

YES

We can get 1974 by swapping N_2 and N_3.

Sample Input 2

1 9 7 4

Sample Output 2

YES

We already have 1974 before doing anything.

Sample Input 3

1 2 9 1

Sample Output 3

NO

Sample Input 4

4 9 0 8

Sample Output 4

NO



Sample input:
1 7 9 4


Sample output:
YES

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
keyence = 'keyence'
ans = 'NO'
for i in range(len(keyence)):
    a = keyence[:i]
    b = keyence[i:]
    print(a + ' ' + b)
    if s.find(a) != -1 and s.find(b) != -1 and s.find(a) + len(a) < s.find(b):
        ans = 'YES'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = 0
input_str = input().split()
input_str_list = []
for x in input_str:
    try:
       input_str_list.append(int(x))
    except:
       pass
if len(input_str_list) == 4:
  pass
else:
  print("NO")
  exit() 

for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
if a==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a = 0
input_str = input()
input_str_list = []
for x in input_str:
    try:
       input_str_list.append(int(x))
    except:
       pass
if len(input_str_list) <= 4:
  pass
else:
  print("NO")
  exit()

for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
if a==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
keyence = 'keyence'

if len(S) == 7: # 空文字列を削除するとき
    if S==keyence:
        print('YES')
    else:
        print('NO')
else :
    for i in range(0,7):
      if keyence[:i] in S and keyence[i:] in S[S.index(keyence[:i])+i:] : # keyenceがある
        if i==0 and S.index(keyence[i:])==0 : # keyenceXXX のとき
            print('YES')
            break
        elif i==0 and S.index(keyence[i:])!=0 and len(S)-7 == S.index(keyence[i:]) : # XXXkeyence のとき
            print('YES')
            break
        elif S.index(keyence[:i])==0 and S[S.index(keyence[i:])+(7-i):] == '' :  # keyXXXenceのとき
            print('YES')
            break
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
s=input()
n = len(s)

for i in range(n): #文字列の長さ分繰り返す
    for j in range(i,n): #
        tmp = s[:i]+s[j:]
        if tmp == "keyence":
            print("YES")
            quit()

print("NO")

Submission status: Wrong Answer

Solution code:
import sys

s=input()
a=0
b=0
c=0
d=0
e=0
f=0
g=0
while s[a]!="k":
    a+=1
    if a==len(s):
        print("NO")
        sys.exit()
b=a+1
while s[b]!="e":
    b+=1
    if b==len(s):
        print("NO")
        sys.exit()
c=b+1
while s[c]!="y":
    c+=1
    if c==len(s):
        print("NO")
        sys.exit()
d=c+1
while s[d]!="e":
    d+=1
    if d==len(s):
        print("NO")
        sys.exit()
e=d+1
while s[e]!="n":
    e+=1
    if e==len(s):
        print("NO")
        sys.exit()
f=e+1
while s[f]!="c":
    f+=1
    if f==len(s):
        print("NO")
        sys.exit()
g=f+1
while s[g]!="e":
    g+=1
    if not "e" in s[g]:
        print("NO")
        sys.exit()
if s=="keyence":print("YES")
else:
    if a!=0 and (b==a+1 and c==b+1 and d==c+1 and e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b!=1 and(c==b+1 and d==c+1 and e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c!=2 and(d==c+1 and e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c==2 and d!=3 and (e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c==2 and d==3 and e!=4 and (f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c==2 and d==3 and e==4 and f!=5 and g==f+1:
        print("YES")
    elif a==0 and b==1 and c==2 and d==3 and e==4 and f==5 and g!=6:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
# B_KEYENCE String

import sys

S = list(input())

key = ['k','e','y','e','n','c','e']
i = 0
for _ in range(len(S)) :
    if S[_] == key[i] :
        i += 1

if i > 6 :
    print("YES")
else :
    print("NO")

Submission status: Wrong Answer

Solution code:
def n_gram(target, n):
    result = []
    for i in range(0, len(target) - n + 1):
        result.append(target[i:i + n])

    return result

x = input()
true="keyence"    
bigram_t = n_gram(true,2)
bigram_x = n_gram(x,2)
cnt= 0
j,old = 0,0
for i in bigram_t:
    j = 0
    while len(bigram_x)>old+j:
        if i == bigram_x[old+j]:
            cnt += 1
            old += j
            break
        j += 1
        
print("YES") if cnt >= len(bigram_t)-2 else print("NO")

Submission status: Wrong Answer

Solution code:
a = 0
input_str = list(input().split())
print(input_str)
for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
if a==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a = 0
input_str = input()
for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
if a==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

cnt=0
keyence="keyence"
flg=[-1,-1,-1,-1,-1,-1,-1]
s=input()

for i in range(len(s)):
    for j in range(len(keyence)):
        if s[i]==keyence[j] and flg[j]==-1:
            flg[j]=i
        elif flg[j]==-1:
            break

for i in range(len(flg)-1):
    if flg[i+1]-flg[i]!=1:
        cnt+=1


if flg[0]!=0:
    cnt+=1
if flg[6]!=len(s)-1:
    cnt+=1

if cnt<2:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

while i < len(n):
  if(n[i]==1 and a==0):
    a = 1
  if(n[i]==9 and b==0):
    b = 1
  if(n[i]==7 and c==0):
    c = 1
  if(n[i]==3 and d==0):
    d = 1
  i = i + 1
  
if(a+b+c+d == 4):
  print('YES')
if(a+b+c+d != 4):
  print('NO')

Submission status: Wrong Answer

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

while i < len(n):
  if(n[i]==1 and a==0):
    a = 1
  if(n[i]==9 and b==0):
    b = 1
  if(n[i]==7 and c==0):
    c = 1
  if(n[i]==3 and d==0):
    d = 1
  i = i + 1
  
if(a+b+c+d == 4):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
S = input ( )

dusted = False
cont = False
line = 'keyence'
find = S.find ( 'keyence' )
rfind = S.rfind ( 'keyence' )
#print ( 'find {} rfind {}'.format ( find, rfind ) )
if find == 0 or rfind == len ( S ) - 7:
    print ( 'YES' )
    exit ( 0 )
elif find != -1:
    print ( 'NO' )
    exit ( 0 )

fs = True
line = ''
keyence = [ c for c in "keyence" ]
for i in range(len ( S )):

    #print ( keyence )
    #print ( 'i {} ri {}'.format ( S[i], S[len(S)-1-i] ) )
    try:
        keyence.remove ( S[len(S)-1-i] )
        if not keyence:
            print ( 'YES' )
            exit ( 0 )
        keyence.remove ( S[i] )

    except ValueError:
        print ( 'NO' )
        exit ( 0 )
    if not keyence:
        print ( 'YES' )
        exit ( 0 )

Submission status: Wrong Answer

Solution code:
a = [1, 9, 7, 4]
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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input().split()
if "1" and "7" and "9" and "4" in S:
  print("Yes")
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import re

a = input()

if re.match('^([a-zA-Z]*?)keyence$', a):
  print("YES")
else:
  if re.match('^k([a-zA-Z]*?)eyence$', a):
    print("YES")
  else:
    if re.match('^ke([a-zA-Z]*?)yence$', a):
      print("YES")
    else:
      if re.match('^key([a-zA-Z]*?)ence$', a):
        print("YES")
      else:
        if re.match('^keye([a-zA-Z]*?)nce$', a):
          print("YES")
        else:
          if re.match('^keyen([a-zA-Z]*?)ce$', a):
            print("YES")
          else:
            if re.match('^keyenc([a-zA-Z]*?)e$', a):
              print("YES")
            else:
              if re.match('^keyence([a-zA-Z]*?)$', a):
                print("YES")
              else:
                print("NO")

Submission status: Wrong Answer

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

for i in [2, 3, 5, 6, 8]:
    if i in a:
        print("NO")
        break
    elif i != 8:
        pass
    else:
        print("YES")

Submission status: Wrong Answer

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

for i in [2, 3, 5, 6, 8]:
    if i in a:
        print("No")
        break
    elif i != 8:
        pass
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:

import re

a = input()

if re.match('^([a-zA-Z]*)keyence$', a):
  print("YES")
else:
  if re.match('^k([a-zA-Z]*)eyence$', a):
    print("YES")
  else:
    if re.match('^ke([a-zA-Z]*)yence$', a):
      print("YES")
    else:
      if re.match('^key([a-zA-Z]*)ence$', a):
        print("YES")
      else:
        if re.match('^keye([a-zA-Z]*)nce$', a):
          print("YES")
        else:
          if re.match('^keyen([a-zA-Z]*)ce$', a):
            print("YES")
          else:
            if re.match('^keyenc([a-zA-Z]*)e$', a):
              print("YES")
            else:
              if re.match('^keyence([a-zA-Z]*)$', a):
                print("YES")
              else:
                print("NO")

Submission status: Wrong Answer

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

for i in [2, 5, 6, 7 ,8]:
    if i in a:
        print("No")
        break
    else:
        if i == 8:
            print("Yes")

Submission status: Wrong Answer

Solution code:
x = input()
print(x)

Submission status: Wrong Answer

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

while i < 4:
  if(n[i]==1 and a==0):
    a = 1
  if(n[i]==9 and b==0):
    b = 1
  if(n[i]==7 and c==0):
    c = 1
  if(n[i]==3 and d==0):
    d = 1
  i = i + 1
  
if(a+b+c+d == 4):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
num = input()

num1 = num[0]
num2 = num[1]
num3 = num[2]
num4 = num[3]

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

isCheck = False
for i in range(4):
    if "1" == num[i]:
        for i in range(4):
            if "9" == num[i]:
                for i in range(4):
                    if "7" == num[i]:
                        for i in range(4):
                            if "4" == num[i]:
                                isCheck = True

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

Submission status: Wrong Answer

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

while i < 4:
  if(n[i]==1 and a==0):
    a = 1
  if(n[i]==9 and b==0):
    b = 1
  if(n[i]==7 and c==0):
    c = 1
  if(n[i]==3 and d==0):
    d = 1
  i = i + 1
  
if(a+b+c+d == 4):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

while i < 4:
  if(n[i]==1 and a==0):
    a = 1
  if(n[i]==9 and b==0):
    b = 1
  if(n[i]==7 and c==0):
    c = 1
  if(n[i]==3 and d==0):
    d = 1
  i = i + 1
  
if(a == 1 and b == 1 and c == 1 and d == 1):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
import re
from sys import stdin
N=(stdin.readline().rstrip())
for i in range(7):
    mae="keyence"[0:i+1]
    ato="keyence"[i+1:8]
    if re.match(".*keyence.*",N):
        print("YES")
        break
    if re.match("%s.*%s"%(mae, ato),N):
        print("YES")
        cnt+=1
        break
if i==6:
    print("NO")

Submission status: Wrong Answer

Solution code:
str_input_list = input().rstrip().split(' ')
int_input_list = []
for a in str_input_list:
    int_input_list.append(int(a))

print(int_input_list)
    
keyence_list = [1, 9, 7, 4]

print(keyence_list)

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

print(keyence_list)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

import re

a = input()
if re.match('^(.*)keyence$', a):
  print("YES")
else:
  if re.match('^k(.*)eyence$', a):
    print("YES")
  else:
    if re.match('^ke(.*)yence$', a):
      print("YES")
    else:
      if re.match('^key(.*)ence$', a):
        print("YES")
      else:
        if re.match('^keye(.*)nce$', a):
          print("YES")
        else:
          if re.match('^keyen(.*)ce$', a):
            print("YES")
          else:
            if re.match('^keyenc(.*)e$', a):
              print("YES")
            else:
              if re.match('^keyence(.*)$', a):
                print("YES")
              else:
                print("NO")

Submission status: Wrong Answer

Solution code:

import re

a = input()
if re.match('(.*)keyence', a):
  print("YES")
else:
  if re.match('k(.*)eyence', a):
    print("YES")
  else:
    if re.match('ke(.*)yence', a):
      print("YES")
    else:
      if re.match('key(.*)ence', a):
        print("YES")
      else:
        if re.match('keye(.*)nce', a):
          print("YES")
        else:
          if re.match('keyen(.*)ce', a):
            print("YES")
          else:
            if re.match('keyenc(.*)e', a):
              print("YES")
            else:
              if re.match('keyence(.*)', a):
                print("YES")
              else:
                print("NO")

Submission status: Wrong Answer

Solution code:
import sys

num = input()

num1 = num[0]
num2 = num[1]
num3 = num[2]
num4 = num[3]

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

Solution code:
import re

a = input()
if re.match('(.*)keyence', a):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s = 'keyence'
S = input()
ans = 'NO'

for i in range(len(S)):
    if S[i] == 'k':
        for l in range(1, len(s)):
            if S[i+l] != s[l]:
                break
        for n in range(len(S)-l):

            if S[i:l] + S[l+n:l+n+7-3] == s:
                ans = 'YES'
                break
    if ans == 'YES':
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

num = input()

num1 = num[0]
num2 = num[1]
num3 = num[2]
num4 = num[3]

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

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

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

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

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

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

Submission status: Wrong Answer

Solution code:
import re
from sys import stdin
N=(stdin.readline().rstrip())
cnt=0
for i in range(7):
    mae="keyence"[0:i+1]
    ato="keyence"[i+1:8]
    if re.match("%s.*%s"%(mae, ato),N):
        print("YES")
        cnt+=1
        break
if cnt==0:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


print(flag)

Submission status: Wrong Answer

Solution code:
s=input()
for i in range(len(s)):
    for j in range(i,len(s)):
        for k in range(j,len(s)):
            for l in range(k,len(s)):
                t=s[i:j]+s[k:l+1]
                if(t=='keyence'):
                    print('YES')
                    exit()
print('NO')

Submission status: Wrong Answer

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

Solution code:
s = input()
target = 'keyence'
s_len = len(s)
flg = 0
target1_len = 0
for i in range(8):
    target1_ind = -1
    target1 = target[0:i]
    target2 = target[i:7]
    if target1 in s:
        target1_ind = s.index(target1)
        print(target1_ind)
        target1_len = len(target1)
        if target2 in s[target1_ind+target1_len:s_len]:
            flg = 1
if flg == 1:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
value = input("input:")
list1 = [int(i) for i in value.split()]

if [1, 4, 7, 9] == sorted(list1):
    print("YES")

else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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")
    print(list)

Submission status: Wrong Answer

Solution code:
import sys

num = input()

num1 = num[0]
num2 = num[1]
num3 = num[2]
num4 = num[3]

strTarget = "1974"

isValidation1 = num1 in strTarget

if isValidation1 :
    strTarget.replace(num1,"")
else:
    print("NO")
    sys.exit()

isValidation2 = num2 in strTarget
if isValidation2 :
    strTarget.replace(num2,"")
else:
    print("NO")
    sys.exit()

isValidation3 = num3 in strTarget
if isValidation3 :
    strTarget.replace(num3,"")
else:
    print("NO")
    sys.exit()

isValidation4 = num4 in strTarget
if isValidation4 :
    strTarget.replace(num4,"")
else:
    print("NO")
    sys.exit()

print("YES")

Submission status: Wrong Answer

Solution code:
import sys, re

P = r'(.*)k(.*)e(.*)y(.*)e(.*)n(.*)c(.*)e(.*)'

s = input().rstrip('\n')

m = re.match(P, s)

if m is not None:
  print([ x for x in m.groups() if x])
  if len([ x for x in m.groups() if x]) <= 1:
    print('YES')
    sys.exit()
print('NO')

Submission status: Wrong Answer

Solution code:

a = list(input().rstrip())


count = 0

for i in range(len(a)):
    if a[i] == 'k':
        count = count + 1
        if a[i+1] == 'e':
            count = count + 1
            if a[i+2] == 'y':
                count = count + 1
                if a[i+3] == 'e':
                    count = count + 1
                    if a[i+4] == 'n':
                        count = count + 1
                        if a[i+5] == 'c':
                            count = count + 1
                            if a[i+5] == 'e':
                                count = count + 1
                            else:
                                break
                        else:
                            break    
                    else:
                        break
                else:
                    break
            else:
                break    
        else:
            break   
    else:
        continue

a.reverse()

for j in range(len(a)):
    if a[i] == 'e':
        count = count + 1
        if a[i+1] == 'c':
            count = count + 1
            if a[i+2] == 'n':
                count = count + 1
                if a[i+3] == 'e':
                    count = count + 1
                    if a[i+4] == 'y':
                        count = count + 1
                        if a[i+5] == 'e':
                            count = count + 1
                            if a[i+5] == 'k':
                                count = count + 1
                            else:
                                break
                        else:
                            break    
                    else:
                        break
                else:
                    break
            else:
                break    
        else:
            break   
    else:
        continue

if count >= 7:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import re

m = re.match('.*k.*e.*y.*e.*n.*c.*e.*', input())
if m:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

j = 0

for i in N:
    if(int(i) != 1 and int(i) != 9 and int(i) != 7 and int(i) != 4):
        j = 1

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

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

Submission status: Wrong Answer

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

res = sorted(set(A), key=A.index)
print(len(res))
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: Wrong Answer

Solution code:
def main():
    value = input("input:")
    list1 = [int(i) for i in value.split()]

    if [1, 4, 7, 9] == sorted(list1):
        print("yes")
        return "YES"
    else:
        print("no")
        return "NO"


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S=input().split()
print(S)
if "1" and "7" and "9" and "4" in S:
  print("Yes")
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N == "1479":
    print("YES")
else:
    print("N0")

Submission status: Wrong Answer

Solution code:

ll = [1, 9, 7, 4]

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

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

Submission status: Wrong Answer

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

if N == "1479":
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Solution code:
s = raw_input()
ans = 'NO'
string = 'keyence'
for i in xrange(len(string)):
	part1 = string[:i+1]
	index1 = s.find(part1)
	if index1 == -1:
		continue
	part2 = string[i+1:]
	modified = s[index1 + 3:]
	if part2 in modified:
		ans = 'YES'
		break
print ans

Submission status: Wrong Answer

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

for num in numberList :
    if num != "1" and num != "7" and num != "9" and num != "4":
        result = 0
    
if result == 1:
    print("YES")
else :
    print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ttt = all((x == 1or x == 9 or x== 7 or x == 4  for x in A))
if ttt:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

for num in numberList :
    if num != "1" and num != "7" and num != "9" and num != "4":
        result = 0
        print(num)
    
if result == 1:
    print("YES")
else :
    print("NO")

Submission status: Wrong Answer

Solution code:
inp = input() 
same = True
l = ['1', '7', '9', '4']
for i in inp:
    for j in l:
        if i is not j:
            same = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ttt = all((x == 1or x == 9 or x== 7 or x == 4  for x in A))
print(ttt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 "N0"

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

flag = True
for n in N:
    if n not in ans:
        print('NO')
        flag =False
    else:
        ans.remove(n)
if flag:
    print('YES')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 = il(str)
for n in N:
    if n not in ["1", "9", "7", "4"]:
        print('NO')
        exit()
print('YES')

Submission status: Wrong Answer

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 max(x1, x9, x7, x4) == 1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
check = [1,9,7,4]
cnt = 0
for i in range(len(N)):
  if(N[i] in check):
    cnt += 1
if(cnt == 4):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

a = [1, 9, 7 ,4]

flg = 0
for i in N:
    for j in a:
        if i == j:
            flg += 1
            
if flg == 4:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 'YES'
for i in A:
    if not i in [1, 9, 7, 4]:
        ans = 'NO'
        break
        
print(ans)

Submission status: Wrong Answer

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

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

    return

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 flag:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
str_input = input() 
print(str_input)