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:
      top = 1
      flont = 2
      right = 3
  
      def do_N(self):
          temp = self.flont
          self.flont = 7 - self.top
          self.top = temp
  
      def do_S(self):
          temp = 7 - self.flont
          self.flont = self.top
          self.top = temp
  
      def do_E(self):
          temp = self.top
          self.top = 7 - self.right
          self.right = temp
  
      def do_W(self):
          temp = 7 - self.top
          self.top = self.right
          self.right = temp
  
  
  num1 = list(map(int, input().split()))
  num2 = list(map(int, input().split()))
  dice1 = dice()
  dice2 = dice()
  flag1 = False
  flag2 = False
  
  if (
      num1[dice1.flont - 1] == num2[dice2.flont - 1]
      and num1[dice1.top - 1] == num2[dice2.top - 1]
  ):
      flag1 = True
      if (
          num1[dice1.right - 1] == num2[dice2.right - 1]
          and num1[7 - dice1.top - 1] == num2[7 - dice2.top - 1]
          and num1[7 - dice1.flont - 1] == num2[7 - dice2.flont - 1]
          and num1[7 - dice1.right - 1] == num2[7 - dice2.right - 1]
      ):
          flag2 = True
  for j in range(4):
      for k in range(4):
          dice1.do_E()
          if (
              num1[dice1.flont - 1] == num2[dice2.flont - 1]
              and num1[dice1.top - 1] == num2[dice2.top - 1]
          ):
              flag1 = True
              if (
                  num1[dice1.right - 1] == num2[dice2.right - 1]
                  and num1[7 - dice1.top - 1] == num2[7 - dice2.top - 1]
                  and num1[7 - dice1.flont - 1] == num2[7 - dice2.flont - 1]
                  and num1[7 - dice1.right - 1] == num2[7 - dice2.right - 1]
              ):
                  flag2 = True
      dice1.do_N()
      if (
          num1[dice1.flont - 1] == num2[dice2.flont - 1]
          and num1[dice1.top - 1] == num2[dice2.top - 1]
      ):
          flag1 = True
          if (
              num1[dice1.right - 1] == num2[dice2.right - 1]
              and num1[7 - dice1.top - 1] == num2[7 - dice2.top - 1]
              and num1[7 - dice1.flont - 1] == num2[7 - dice2.flont - 1]
              and num1[7 - dice1.right - 1] == num2[7 - dice2.right - 1]
          ):
              flag2 = True
  
  dice1.do_S()
  dice1.do_E()
  if (
      num1[dice1.flont - 1] == num2[dice2.flont - 1]
      and num1[dice1.top - 1] == num2[dice2.top - 1]
  ):
      flag1 = True
      if (
          num1[dice1.right - 1] == num2[dice2.right - 1]
          and num1[7 - dice1.top - 1] == num2[7 - dice2.top - 1]
          and num1[7 - dice1.flont - 1] == num2[7 - dice2.flont - 1]
          and num1[7 - dice1.right - 1] == num2[7 - dice2.right - 1]
      ):
          flag2 = True
  for j in range(4):
      for k in range(4):
          dice1.do_E()
          if (
              num1[dice1.flont - 1] == num2[dice2.flont - 1]
              and num1[dice1.top - 1] == num2[dice2.top - 1]
          ):
              flag1 = True
              if (
                  num1[dice1.right - 1] == num2[dice2.right - 1]
                  and num1[7 - dice1.top - 1] == num2[7 - dice2.top - 1]
                  and num1[7 - dice1.flont - 1] == num2[7 - dice2.flont - 1]
                  and num1[7 - dice1.right - 1] == num2[7 - dice2.right - 1]
              ):
                  flag2 = True
      dice1.do_N()
      if (
          num1[dice1.flont - 1] == num2[dice2.flont - 1]
          and num1[dice1.top - 1] == num2[dice2.top - 1]
      ):
          flag1 = True
          if (
              num1[dice1.right - 1] == num2[dice2.right - 1]
              and num1[7 - dice1.top - 1] == num2[7 - dice2.top - 1]
              and num1[7 - dice1.flont - 1] == num2[7 - dice2.flont - 1]
              and num1[7 - dice1.right - 1] == num2[7 - dice2.right - 1]
          ):
              flag2 = True
  
  if flag1 and flag2:
      print("Yes")
  else:
      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"}]