Problem:
Score : 100 points

Problem Statement

Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.
Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.

Constraints

x and y are integers.

1 ≤ x < y ≤ 12

Input

Input is given from Standard Input in the following format:

x y

Output

If x and y belong to the same group, print Yes; otherwise, print No.

Sample Input 1

1 3

Sample Output 1

Yes

Sample Input 2

2 4

Sample Output 2

No

Solution in C (Clang 10.0.0) (judge verdict: Accepted)

#include <stdio.h>
 
#define GROUP_1_MAX 7
#define GROUP_2_MAX 4
#define GROUP_3_MAX 1
 
typedef struct {
  int group[GROUP_1_MAX];
} GROUP_t;
 
int checkNum( GROUP_t *a_pstGroup, int x, int y, int groupNum );
 
int main(){
  int x,y,ret1,ret2,ret3;
  GROUP_t stGroup1 = { 1, 3, 5, 7, 8, 10, 12 };
  GROUP_t stGroup2 = { 4, 6, 9, 11 };
  GROUP_t stGroup3 = { 2 };
  
  scanf( "%d", &x );
  scanf( "%d", &y );
  
  ret1 = checkNum( &stGroup1, x, y, GROUP_1_MAX );
  ret2 = checkNum( &stGroup2, x, y, GROUP_2_MAX );
  ret3 = checkNum( &stGroup3, x, y, GROUP_3_MAX );
  if( ( ret1 != 0 ) || ( ret2 != 0 ) || ( ret3 != 0 ) ) {
    printf( "%s\n", "Yes" );
  } else {
    printf( "%s\n", "No" );
  }
  
  return 0;
}
 
int checkNum( GROUP_t *a_pstGroup, int x, int y, int groupNum ) {
  int i, ret, x_count = 0, y_count = 0;
  
  for( i = 0; i < groupNum; i++ ){
    if( x == a_pstGroup->group[i] ){
      x_count = 1;
    }
    if( y == a_pstGroup->group[i] ){
      y_count = 1;
    }
  }
  if ( ( x_count == 1 ) && ( y_count == 1 ) ) {
    ret = groupNum;
  } else {
    ret = 0;
  } 
  
  return ret;
}