program grouping
  implicit none
  integer :: x, y, z(12)
  z = (/1,3,1,2,1,2,1,1,2,1,2,1/)
  read(*,*) x, y
  if (z(x).eq.z(y)) then
    write(*,'(a)') "Yes"
  else
    write(*,'(a)') "No"
  end if
end program grouping