y,x=gets.scan(/\d/).map &:to_i puts y>6||[63,95,59,95,47,21,10][y][x]<1?:NO:'YES'