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)

#![allow(unused)]
use std::io;
use std::collections::*;
use std::str::FromStr;

fn main() {
    let gid = vec![-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    let (x, y): (usize, usize) = read_tuple2();

    if gid[x] == gid[y] {
        println!("Yes");
    } else {
        println!("No");
    }
}


fn read_line() -> String {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("failed to read line");
    buffer
}

fn read_i32() -> i32 {
    read_line().trim().parse().unwrap_or_else(|e| panic!("{}", e))
}

fn read_tuple2<S:FromStr, T:FromStr>() -> (S, T) {
    let v: Vec<String> = read_tokens();
    return (
        v[0].parse().unwrap_or_else(|e| panic!("ohmygod")),
        v[1].parse().unwrap_or_else(|e| panic!("ohmygod"))
    )
}

fn read_tuple3<S:FromStr, T:FromStr, U:FromStr>() -> (S, T, U) {
    let v: Vec<String> = read_tokens();
    return (
        v[0].parse().unwrap_or_else(|e| panic!("ohmygod")),
        v[1].parse().unwrap_or_else(|e| panic!("ohmygod")),
        v[2].parse().unwrap_or_else(|e| panic!("ohmygod"))
    )
}

fn read_tokens<T: std::str::FromStr>() -> Vec<T> {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("failed to read line");
    let mut buffer = buffer.split_whitespace();
    let mut tokens = vec![];
    loop {
        match buffer.next() {
            Some(token) => tokens.push(token.to_string().parse().unwrap_or_else(|e| panic!("ohmygod"))),
            None        => break
        }
    }
    tokens
}