unittest
{
	assert( [ "1 3" ].parse.expand.solve == "Yes" );
	assert( [ "2 4" ].parse.expand.solve == "No" );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto xy = input.front.split.to!( long[] );
	return tuple( xy[ 0 ], xy[ 1 ] );
}

auto solve( long x, long y )
{
	auto xg = 0L;
	if( x == 4 || x == 6 || x == 9 || x == 11 ) xg = 1;
	if( x == 2 ) xg = 2;
	
	auto yg = 0L;
	if( y == 4 || y == 6 || y == 9 || y == 11 ) yg = 1;
	if( y == 2 ) yg = 2;
	
	return ( xg == yg ) ? "Yes" : "No";
}
