#import <Foundation/Foundation.h>
int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    NSArray *A = @[@1,@3,@5,@6,@8,@10,@12];
    NSArray *B = @[@4,@6,@9,@11];
    printf((([A containsObject:@(a)] && [A containsObject:@(b)])) || (([B containsObject:@(a)] && [B containsObject:@(b)])) ? "Yes":"No");
}
