output_description: 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`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N_1 N_2 N_3 N_4
attempt: 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())
  
problem_description: 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".
samples: [{"input": "1 7 9 4", "output": "YES\n    \n\nWe can get 1974 by swapping N_2 and N_3.\n\n* * *"}, {"input": "1 9 7 4", "output": "YES\n    \n\nWe already have 1974 before doing anything.\n\n* * *"}, {"input": "1 2 9 1", "output": "NO\n    \n\n* * *"}, {"input": "4 9 0 8", "output": "NO"}]