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:
def main():
    S = input()
    ans = 'keyence'
    cnt = 0
    j = 0
    if S[0] != 'k':
        for i in range(len(S)-6):
            if S[i] == ans[j]:
                while True:
                    j += 1
                    i += 1
                    if j == 7:
                        return('YES')
                    elif S[i] != ans[j]:
                        break
        return ('NO')
    else:
        i = 0
        while True:
            i += 1
            j += 1
            if j == 7 and i == len(S):
                return('YES')
            elif S[i] != ans[j]:
                break
        #print(i,j)
        #print(S[69])
        for k in range(i,len(S)-(7-j-1),1):
            tmp = j
            #print(tmp,k,len(S)-j)
            if S[k] == ans[tmp]:
                while True:
                    #print(tmp,k)
                    tmp += 1
                    k += 1
                    if tmp == 7 and k == len(S):
                        return('YES')
                    elif tmp == 7 and k != len(S):
                        return('NO')
                    elif S[k] != ans[tmp]:
                        break
        return('No')

print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = "keyence"
for i in range(len(K)):
  if (K[:i] == S[:i]) and (K[(i-(len(K))):] == S[(i-(len(K))):]):
    print("YES")
    exit()
if K == S[:len(K)] or K == S[(-len(K)):]:
  print("YES")
  exit()
print("NO")

Submission status: Wrong Answer

Solution code:
S = input()
K = "keyence"
for i in range(len(K)):
  print(S[:i], S[(i-(len(K))):])
  if (K[:i] == S[:i]) and (K[(i-(len(K))):] == S[(i-(len(K))):]):
    print("YES")
    exit()
if K == S[:len(K)] or K == S[(-len(K)):]:
  print("YES")
  exit()
print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#キーエンス プログラミング コンテスト 2019 a
n=list(map(int,input().split()))
if ('1' in n) and ('9' in n) and ('7' in n) and ('4' in n):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = [int(i) for i in input().split()]
n.sort()
if n[0] == 1 and n[1] == 4 and n[2] == 7 and n[3] == 9:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
list0_9 = [0 for i in range(10)]
for i in N:
  list0_9[i]+=1
if list0_9[1] == list0_9[2] == list0_9[7] == list0_9[9] == 1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
print("YES" if sorted(input())=='1479' else "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:
n=input()
n=sorted(n)
if n=='1479':
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
import sys
S = input()


for i in range(len(S)):
    for j in range(i,len(S)):
        
        if "keyence" == (S[:i]) + (S[j:]):
            print("YES")
            sys.exit()

print("NO")

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(7):
    if s[:i] + s[-7 + i:] == "keyence":
        print("YES")
        exit()
print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
A1 = A.count("1")
A9 = A.count("9")
A7 = A.count("7")
A4 = A.count("4")
if A1 == 1 and A9 == 1 and A7 == 1 and A4 == 1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
A1 = A.count("1")
A9 = A.count("9")
A7 = A.count("7")
A4 = A.count("4")
if A1 == A9 == A7 == A4 == 1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def resolve():
   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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nums = list(map(str, input().split()))
flg = False
if len(set(nums)) != 4:
    pass
else:
    for num in nums:
        if num in "1974":
            flg = True
        else:
            continue
if flg == True:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

li = [1,9,7,4]

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

Submission status: Wrong Answer

Solution code:
import re
s = input()
pat = ".*keyence"
pat2 = "keyence.*"
pat3 = "key.*ence"
if re.findall(pat, s) or re.findall(pat2, s) or re.findall(pat3, s):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s=str(input())
if s=="keyence":
  print("YES")
  exit()
f=False
for i in range(len(s)-1):
  for j in range(i+1,len(s)):
    if s[:i]+s[j:]=="keyence":
      f=True
      break
print("YES" if f==True else "NO")

Submission status: Wrong Answer

Solution code:
s=str(input())
f=False
for i in range(len(s)-1):
  for j in range(i+1,len(s)):
    if s[:i]+s[j:]=="keyence":
      f=True
      break
print("YES" if f==True else "NO")

Submission status: Wrong Answer

Solution code:
n = set(input().split())
a = {"1", "9", "7", "4"}

print("YES" if n <= a else "NO")

Submission status: Wrong Answer

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

    if a+b+c+d == 21:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[1,7,9,4]
c=[0]*4
d=[True,True,True,True]

for i in range(4):
    c[i]=(b[i] in a)
if c==d:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N = list(input().split())
ansList = ["1","7","9","4"]
Flag = "Yes"
for i in N:
    if not i in ansList:
        Flag = "No"
        break
print(Flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = list(input())
ans = list("keyence")
count = 0
check = 0
check2 = 0
check3 = 0
for i in range(len(l)-6):
  check3 = 0
  for j in range(7):
    
    if l[i+j]==ans[j]:
      check3 += 1
      
  if check3==7:
    print("YES")
    exit()
for i in range(len(l)):
  if l[i] == ans[count]:
    check2 = 0
    count += 1
  else:
    if check2 == 1:
      continue
    else:
      check += 1
      check2 = 1
  if count == 7:
    if 1 >= check:
      print("YES")
      exit()
    else:
      print("NO")
      exit()
\
print("NO")

Submission status: Wrong Answer

Solution code:
l = list(map(int,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: Wrong Answer

Solution code:
N =[int(n) for n in input().split(' ')]
 
M = [1, 9, 7, 4]
 
if set(N)==set(M):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c,d=[int(n) for n in input().split(' ')]

N = [1, 9, 7, 4]

if a not in N:
    print("No")
else:
    N.remove(a)
    if b not in N:
        print("No")
    else:
        N.remove(b)
        if c not in N:
            print("No")
        else:
            N.remove(c)
            if d not in N:
                print("Np")
            else:
                print("Yes")

Submission status: Wrong Answer

Solution code:
a = input()
if '1' in a and '7' in a and '9' in a and '4' in a:
  print('YES')

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
N.sort()
print("Yes" if N[0]*1000+N[1]*100+N[2]*10+N[3] == 1479 else "No")

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
N.sort()
print("Yes" if N[0]*1000+N[1]*100+N[2]*10+N[3] == 1974 else "No")

Submission status: Wrong Answer

Solution code:
import sys
if sys.platform =='ios':
	sys.stdin=open('input.txt')
	
l = list(map(int,input().split()))

l.sort()

print(''.join(list(map(str, l))))

if ''.join(list(map(str, l)))=='1479':
	print('YES')
else:
	print('NO')

Submission status: Wrong Answer

Solution code:
import sys
if sys.platform =='ios':
	sys.stdin=open('input.txt')
	
l = list(map(int,input().split()))

l.sort()

print(''.join(list(map(str, l))))

if ''.join(list(map(str, l)))=='1479':
	print('YES')
else:
	print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())

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

Submission status: Wrong Answer

Solution code:
import sys
N1, N2, N3, N4 = map(str, input().split())
tmp = N1 + N2 + N3 + N4

for i in tmp:
    if '1974'.count(i) != 1:
        print('NO')
        sys.exit()

print('YES')

Submission status: Wrong Answer

Solution code:
import sys
N1, N2, N3, N4 = map(str, input().split())
tmp = N1 + N2 + N3 + N4

for i in tmp:
    if '1974'.count(i) == 0:
        print('NO')
        sys.exit()

print('YES')

Submission status: Wrong Answer

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

for i in range(len(n)):
    if n[i]=="1":
        for j in range(n):
            if n[j]=="9":
                for k in range(n):
                    if n[k]=="7":
                        for l in range(n):
                            if n[l]=="4":
                                print("YES")
                                exit()
print("NO")

Submission status: Wrong Answer

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

for i in range(len(n)):
    if n[i]=="1":
        for j in range(n):
            if n[j]=="9":
                for j in range(n):
                    if n[i]=="7":
                        for j in range(n):
                            if n[i]=="4":
                                print("YES")
                                exit()
print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n.extend([1,9,7,4])

n = set(n)

if len(n) == 4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = [int(n) for n in input().split(" ")]
c1 = 0
c9 = 0
c7 = 0
c4 = 0
for num in list:
  if num == 1:
    c1 += 1
  elif num == 9:
    c9 += 1
  elif num == 7:
    c7 += 1
  elif num == 4:
    c4 += 1
if c1 and c9 and c7 and c4:
  print("YES")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import collections as cl

list = [int(n) for n in input().split(" ")]
dic = cl.Counter(list)
if dic[1] and dic[9] and dic[7] and dic[4]:
  print("YES")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Solution code:
a = list(map(int, input().split()))
count_a = 0
count_b = 0
count_c = 0
count_d = 0

for i in range(4):
    if a[i] == 1:
        count_a += 1
    if a[i] == 4:
        count_b += 1
    if a[i] == 7:
        count_c += 1
    if a[i] == 9:
        count_d += 1

if count_a == 1 and count_b == 1 and count_c == 1 and count_d == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n=set(map(str,input().split()))
k={'1','9','7','4'}
if n==k:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
judge=True
y=[]
y=list(map(int, input().split()))
for count,i in enumerate(y):
    if(y[count]==1 or y[count]==9 or y[count]==7 or y[count]==4):
        judge=True
    else:
        judge=False
        break
if(judge==True):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
x=[]
judge=True
y=[]
x.append(input().split())
for count,i in enumerate(x):
    y.append(int(x[0][count]))
for count,i in enumerate(y):
    if(y[count]==1 or y[count]==9 or y[count]==7 or y[count]==4):
        pass
    else:
        judge=False
if(judge==True):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

flag = False
for i in range(len(S)):
    for j in range(i, len(S)):
        s = S[:i] + S[j:]
        if s == 'keyence':
            flag = True

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

Submission status: Wrong Answer

Solution code:
import re

S = input()
pattern = r"(.+keyence|k.+eyence|ke.+yence|key.+ence|keye.+nce|keyen.+ce|keyenc.+e|keyence.+|keyence)"
if re.fullmatch(pattern, S):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = 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: Wrong Answer

Solution code:
n= 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: Wrong Answer

Solution code:
k = "keyence"
l = len(k)

S = input()

if any([0 <= S.find(k[:i]) < S.rfind(k[i:]) for i in range(l)]):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
A = str(input())



for i in range(len(A)):
  for j in range(len(A)):
    b =A[:i]+A[len(A)-j:len(A)]
    if b == "keyence":
      print("YES")
      exit()
    elif i==len(A):
      print("NO")
      exit()
    else:
      continue

Submission status: Wrong Answer

Solution code:
l="keyence"
i=input()
if l in i:
    if i.find(l)==0 or i.find(l)==-7:
        print("YES")
        exit()
for s in range(1,7):
    if (l[:s] in i) and (l[s:] in i):
        if (i.find(l[:s]) < i.find(l[s:])) and i.find(l[:s])==0:
            print("YES")
            exit()
print("NO")

Submission status: Wrong Answer

Solution code:
s=input()
result=False
for i in range(len(s)):
    for j in range(i,len(s)):
        if s[:i]+s[j:]=="keyence":
            result=True
            break
if result:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
clist = list(map(int,input().split()))
clist.sort()
ans = "No"
if min(clist) == 1 and max(clist) == 9 :
  clist.pop(0)
  clist.pop()
  if min(clist) == 4 and max(clist) == 7 :
    ans = "Yes"
  else:
    ans = "No"
else:
  ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
import re
chars = input()
ptns = {'[a-x]*(keyence)+','(k)+[a-x]*(eyence)+','(ke)+[a-x]*(yence)+','(key)+[a-x]*(ence)+','(keye)+[a-x]*(nce)+','(keyen)+[a-x]*(ce)+','(keyenc)+[a-x]*(e)+','(keyence)+[a-x]*'}
cnt = 0
for ptn in ptns:
  isPTN = re.match(ptn, chars) != None;
  if isPTN == True:
    print("YES")
    break
  cnt = cnt + 1
if cnt == 8:
	print("NO")

Submission status: Wrong Answer

Solution code:
import re
chars = input()
ptns = {'[a-z]*(keyence)+','(k)+[a-z](eyence)+','(ke)+[a-z]*(yence)+','(key)+[a-x]*(ence)+','(keye)+[a-z]*(nce)+','(keyen)+[a-z]*(ce)+','(keyenc)+[a-z]*(e)+','(keyence)+[a-z]*'}
cnt = 0
for ptn in ptns:
  isPTN = re.match(ptn, chars) != None;
  if isPTN == True:
    print("YES")
    break
  cnt = cnt + 1
if cnt == 8:
	print("NO")

Submission status: Wrong Answer

Solution code:
import re
chars = input()
ptns = {'[a-x]*(keyence)+','(k)+[a-x](eyence)+','(ke)+[a-x]*(yence)+','(key)+[a-x]*(ence)+','(keye)+[a-x]*(nce)+','(keyen)+[a-x]*(ce)+','(keyenc)+[a-x]*(e)+','(keyence)+[a-x]*'}
cnt = 0
for ptn in ptns:
  isPTN = re.match(ptn, chars) != None;
  if isPTN == True:
    print("YES")
    break
  cnt = cnt + 1
if cnt == 8:
	print("NO")

Submission status: Wrong Answer

Solution code:
import re
chars = input()
ptns = {'[a-x]*(keyence)+','(k)+[a-x](eyence)+','(ke)+[a-x]*(yence)+','(key)+[a-x]*(ence)+','(keye)+[a-x]*(nce)+','(keyen)+[a-x]*(ce)+','(keyenc)+[a-x]*(e)+','(keyence)+[a-x]*'}
cnt = 0
for ptn in ptns:
  isPTN = re.match(ptn, chars) != None;
  if isPTN == True:
    print("YES")
    break
  cnt = cnt + 1
if cnt == 7:
	print("NO")

Submission status: Wrong Answer

Solution code:
stringEnter = input()
target = "keyence"
counter = 0
targetCounter = 0
while(counter < len(stringEnter) and targetCounter < len(target)):
 if(stringEnter[counter] == target[targetCounter]):
  targetCounter += 1
 counter += 1
if(targetCounter == len(target)):
 print("YES");
else:
 print("NO");

Submission status: Wrong Answer

Solution code:
get=input()
flg=0
for a in get.split(" "):
  if int(a) in[1,9,7,4]:
    flg+=1
    
if flg==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
get=input()
flg=0
print(get.split(" "))
print(get.split())
for a in get.split(" "):
  if int(a) in[1,9,7,4]:
    flg+=1
    
print(flg)
if flg==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
get=input()
flg=0
for a in get.split():
  if int(a) in [1,9,7,4]:
    flg=+1
    
if flg==3:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
get=input()
flg=0
for a in get.split():
  if int(a) in[1,9,7,4]:
    flg=+1
    
if flg==4:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def data_input():
    a = input()
    return a
def answer(data = None):
    """
    >>> output('keyence')
    YES
    >>> output('keyaaaaence')
    YES
    >>> output('keyaaeaance')
    NO
    >>> output('keyaenceaaaa')
    YES
    >>> output('aaaakeyence')
    YES
    >>> output('keyenceaaaa')
    YES
    >>> output('keyencaaaaa')
    NO
    """
    if data:
        s = data
    else:
        s = data_input()
    k_list = 'keyence'
    k = 0
    n = len(s)
    slide = 0
    for i in range(n):
        if k < len(k_list) and s[i] == k_list[k]:
            k += 1
        else:
            slide = i
            break
    return k_list[k:] in s[slide:]

def output(data = None):
    res = answer(data)
    if res:
        print('YES')
    else:
        print('NO')
output()

Submission status: Wrong Answer

Solution code:
target = input()
search_string = 'keyence'
split_index = 8
while 0 <= split_index:
    split_index -= 1
    head = search_string[0:split_index]
    tail = search_string[split_index:]
    find_index = target.find(head)
    rfind_index = target.rfind(tail)
    # print('head: ' + str(find_index)  + ' : ' + head)
    # print('tail: ' + str(rfind_index) + ' : ' + tail)
    if find_index == -1 or rfind_index == -1:
        continue
    if (find_index + len(head)) <= rfind_index:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

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,'')
    print(s)
    if len(s) == 0:
        print('YES')
    else:
        print('NO')
answer()

Submission status: Wrong Answer

Solution code:
def data_input():
    a,b,c,d = input().split(' ')
    return (a,b,c,d)
def answer():
    
    print('NO')
answer()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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')
    print('NO')
answer()

Submission status: Wrong Answer

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:
      return True
    return False
print(answer())

Submission status: Wrong Answer

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.replace(a,'')
    s.replace(b,'')
    s.replace(c,'')
    s.replace(d,'')
    if len(s) == 0:
      return True
    return False
answer()

Submission status: Wrong Answer

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'
    return a in s and b in s and c in s and d in s
answer()

Submission status: Wrong Answer

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'

if __name__ == "__main__":
    year_number_judger = YearNumberJudger()
    is_first_paramter = True
    for arg in sys.argv:
        if is_first_paramter:
            is_first_paramter = False
            continue
        year_number_judger.input(arg)
    print(year_number_judger.result())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Solution code:
def checkInput(inputList):
    numberList = [1,9,7,4]
    result = all(num in numberList for num in inputList)
    if(result):
        return True
    else:
        return False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = set(input())
A = set('1974')
print(N==A)

Submission status: Wrong Answer

Solution code:
s = input()
if s.find("keyence") != -1:
    print("YES")
else:
    if len(s) < 7:
        print("NO")
    else:
        cond = False
        for i in range(1,7):
            if s[0:i]+s[-(7-i):] == "keyence":
                cond = True
                print("YES")
                break
        if cond == False:
            print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
flg = 0

target_S = "keyence"

if S.startswith(target_S) or S.endswith(target_S):
    flg = 1
else:
    for i in range(len(target_S)):
        target_left = target_S[:i]
        target_right = target_S[i:]
        
        if S.startswith(target_left) and S.endswith(target_right):
            flg = 1

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

Submission status: Wrong Answer

Solution code:
num_list = list(map(int,input().split(' ')))
print(num_list)
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: Wrong Answer

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


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

    for number in numbers:
        count += n.count(number)

    if count == 4:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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:
    print(num)
    flg = False
if(flg):
	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 in l):    
    pass
  else:
    flg = False
if(flg):
	print("YES")
else:
    print("NO")