output_description: Print "Yes" if two dices are identical, otherwise "No" in a line.
input_description: In the first line, six integers assigned to faces of a dice are given in
  ascending order of their corresponding labels.  
  In the second line, six integers assigned to faces of another dice are given
  in ascending order of their corresponding labels.
attempt: d1 = input().split()
  d2 = input().split()
  
  
  def roll(Dice, Vector):
      if Vector == "N":
          c = Dice[0]
          Dice[0] = Dice[1]
          Dice[1] = Dice[5]
          Dice[5] = Dice[4]
          Dice[4] = c
      elif Vector == "W":
          c = Dice[0]
          Dice[0] = Dice[2]
          Dice[2] = Dice[5]
          Dice[5] = Dice[3]
          Dice[3] = c
      elif Vector == "E":
          c = Dice[0]
          Dice[0] = Dice[3]
          Dice[3] = Dice[5]
          Dice[5] = Dice[2]
          Dice[2] = c
      elif Vector == "S":
          c = Dice[0]
          Dice[0] = Dice[4]
          Dice[4] = Dice[5]
          Dice[5] = Dice[1]
          Dice[1] = c
  
  
  v = list("NNNNWNNNWNNNENNNENNNWNNN")
  f = 0
  for item in v:
      roll(d2, item)
      if d1 == d2:
          print("Yes")
          f += 1
          break
  if f == 0:
      print("No")
  
problem_description: Dice III
  
    
  
  Write a program which reads the two dices constructed in the same way as Dice
  I, and determines whether these two dices are identical. You can roll a dice
  in the same way as Dice I, and if all integers observed from the six
  directions are the same as that of another dice, these dices can be considered
  as identical.
samples: [{"input": "1 2 3 4 5 6\n    6 2 4 3 5 1", "output": "Yes"}, {"input": "1 2 3 4 5 6\n    6 5 4 3 2 1", "output": "No"}]