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 Rust (1.15.1) (judge verdict: Accepted)

use std::io;
use std::collections::HashSet;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let x = v[0];
	let y = v[1];
	let mut set1:HashSet<i32> = HashSet::new();
	set1.insert(1);
	set1.insert(3);
	set1.insert(5); 
	set1.insert(7);
	set1.insert(8);
	set1.insert(10);
	set1.insert(12);
	let mut set2:HashSet<i32> = HashSet::new();
	set2.insert(4);
	set2.insert(6);
	set2.insert(9);
	set2.insert(11);
	let mut set3:HashSet<i32> = HashSet::new();
	set3.insert(2);
	let mut flag = false;
	if !set1.insert(x) && !set1.insert(y) {
		flag = true;
	}
	if !set2.insert(x) && !set2.insert(y) {
		flag = true;
	}
	if !set3.insert(x) && !set3.insert(y) {
		flag = true;
	}
	if flag {
		println!("Yes");
	}else{
		println!("No");
	}
}