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: class Dice:
      def make_dice(self, value):
          self.face = value
  
      def move(self, direc):
          if direc == "N":
              self.face = [
                  self.face[1],
                  self.face[5],
                  self.face[2],
                  self.face[3],
                  self.face[0],
                  self.face[4],
              ]
              return self.face
          elif direc == "E":
              self.face = [
                  self.face[3],
                  self.face[1],
                  self.face[0],
                  self.face[5],
                  self.face[4],
                  self.face[2],
              ]
              return self.face
          elif direc == "S":
              self.face = [
                  self.face[4],
                  self.face[0],
                  self.face[2],
                  self.face[3],
                  self.face[5],
                  self.face[1],
              ]
              return self.face
          elif direc == "W":
              self.face = [
                  self.face[2],
                  self.face[1],
                  self.face[5],
                  self.face[0],
                  self.face[4],
                  self.face[3],
              ]
              return self.face
  
      def check_face(self, face1):
          for i in range(4):
              if face1 == self.face:
                  return self.face
              else:
                  self.face[1], self.face[2], self.face[4], self.face[3] = (
                      self.face[2],
                      self.face[4],
                      self.face[3],
                      self.face[1],
                  )
  
  
  num1 = list(map(int, input().split()))
  num2 = list(map(int, input().split()))
  dice1 = Dice()
  dice2 = Dice()
  dice1.make_dice(num1)
  for i in range(6):
      dice2.make_dice(num2)
      if i == 0:
          dice2.check_face(dice1.face)
          if dice1.face == dice2.face:
              print("Yes")
              break
      elif i == 1:
          dice2.move("N")
          dice2.check_face(dice1.face)
          if dice1.face == dice2.face:
              print("Yes")
              break
      elif i == 2:
          dice2.move("E")
          dice2.check_face(dice1.face)
          if dice1.face == dice2.face:
              print("Yes")
              break
      elif i == 3:
          dice2.move("S")
          dice2.check_face(dice1.face)
          if dice1.face == dice2.face:
              print("Yes")
              break
      elif i == 4:
          dice2.move("W")
          dice2.check_face(dice1.face)
          if dice1.face == dice2.face:
              print("Yes")
              break
      elif i == 5:
          dice2.move("N")
          dice2.move("N")
          dice2.check_face(dice1.face)
          if dice1.face == dice2.face:
              print("Yes")
              break
          else:
              print("No")
              break
  
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"}]