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++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <cassert>
#include <fstream>
#include <cstring>
#include <queue>
#include <algorithm>
#include <bitset>
#include <ctime>
#include <set>
#include <cmath>
#include <unordered_map>
#include <iomanip>
#include <map>
#include <stack>
#include <vector>
#include <bitset>
#include <functional>
#include <iostream>

using namespace std;

#define FOR(i, a, n) for (int i = a; i <= n; ++i)
#define FORN(a, n) for (int i = a; i < n; ++i)
#define ROF(i, n, a) for (int i = n; i >= a; i--)
#define ROFN(n, a) for (int i = n - 1; i >= a; i--)
#define FIT(i, v) for (auto &i : v)
#define pb push_back
#define mp make_pair
#define mt make_touple
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define log log2

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const long long mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; }

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);

	vector<int> v1 = { 1, 3, 5, 7, 8, 10, 12 };
	vector<int> v2 = { 4, 6, 9, 11 };
	
	int x, y;
	cin >> x >> y;
	if (x == 2 && y == 2) {
		cout << "Yes";
		return 0;
	}

	int ok = 0;

	for (int i = 0; i < v1.size(); ++i) {
		if (x == v1[i]) {
			ok++;
		}
		if (y == v1[i]) {
			ok++;
		}
	}

	if (ok == 2) {
		cout << "Yes";
		return 0;
	}
	ok = 0;

	for (int i = 0; i < v2.size(); ++i) {
		if (x == v2[i]) {
			ok++;
		}
		if (y == v2[i]) {
			ok++;
		}
	}
	if (ok == 2) {
		cout << "Yes";
		return 0;
	}
	cout << "No";
	return 0;
}