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# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("1 3");
            //Yes
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("2 4");
            //No
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] wkArr = InputList[0].Split(' ').Select(A => int.Parse(A)).ToArray();
        int X = wkArr[0];
        int Y = wkArr[1];

        int[] Group1Arr = new int[] { 1, 3, 5, 7, 8, 10, 12 };
        int[] Group2Arr = new int[] { 4, 6, 9, 11 };
        int[] Group3Arr = new int[] { 2 };

        if (Group1Arr.Contains(X) && Group1Arr.Contains(Y)
         || Group2Arr.Contains(X) && Group2Arr.Contains(Y)
         || Group3Arr.Contains(X) && Group3Arr.Contains(Y)) {
            Console.WriteLine("Yes");
        }
        else Console.WriteLine("No");
    }
}