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: 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")
  
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"}]