Module Program
  Sub Main
    Dim s=GetInts()
    Dim x=foo(s(0)),y=foo(s(1))
    Dim ans=If(x=y,"Yes","No")
    Console.WriteLine(ans)
  End Sub
    Function foo(x As Integer) As Integer
      Select Case x
      Case 2
        Return 0
      Case 4,6,9,11
        Return 1
      Case Else
        Return 2
      End Select
    End Function
  
  '/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  Function Gets() As String()
    Gets = Console.ReadLine().Split(" "c)
  End Function
  Function GetInts() As Integer()
    Dim s = Gets(), r(UBound(s)) As Integer
    For i As Integer=0 To UBound(s): r(i)=s(i): Next i
    GetInts = r
  End Function
End Module