Problem:
Score : 200 points

Problem Statement

There are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.

Takahashi says: "there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.

Constraints

1 \leq X \leq 100

1 \leq Y \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.

Sample Input 1

3 8

Sample Output 1

Yes

The statement "there are 3 animals in total in the garden, and they have 8 legs in total" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.

Sample Input 2

2 100

Sample Output 2

No

There is no combination of numbers of cranes and turtles in which this statement is correct.

Sample Input 3

1 2

Sample Output 3

Yes

We also consider the case in which there are only cranes or only turtles.

Solution in C# (.NET Core 3.1.201) (judge verdict: Accepted)

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

namespace cs
{
    class Program
    {
        static void Main(string[] args)
        {
            var pg = new Program();
            //pg.Test();
            pg.Execute();

        }
        private void Test()
        {
            OutputResult(0);
            OutputResult(1);
            OutputResult(2);
            OutputResult(4);
        }

        private void Execute()
        {
            var (X, Y) = ReadLinesTuple2<int>();

            var c = X;
            var t = 0;
            while(c >= 0){
                if(c * 2 + t * 4 == Y){
                    OutputResult("Yes");
                    return;
                }
                c--;
                t++;
            }
                OutputResult("No");
        }


        private void OutputResult<T>(T result)
        {
            Console.WriteLine(result);
        }

        private void OutputList<TItem, TList>(TList result)
            where TList : IEnumerable<TItem>
        {
            result.ToList().ForEach(e => Console.WriteLine(e));
        }

        private static T ReadLine<T>()
        {
            return (T)Convert.ChangeType(Console.ReadLine(), typeof(T));
        }
        private static IEnumerable<T> ReadLinesList<T>()
        {
            return Console.ReadLine().Split(' ').Select(i => (T)Convert.ChangeType(i, typeof(T)));
        }

        public static (T, T) ReadLinesTuple2<T>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T)Convert.ChangeType(input.ElementAt(0), typeof(T)), (T)Convert.ChangeType(input.ElementAt(1), typeof(T)));
        }
        public static (T, T, T) ReadLinesTuple3<T>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T)Convert.ChangeType(input.ElementAt(0), typeof(T)), (T)Convert.ChangeType(input.ElementAt(1), typeof(T)), (T)Convert.ChangeType(input.ElementAt(2), typeof(T)));
        }
        public static (T, T, T, T) ReadLinesTuple4<T>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T)Convert.ChangeType(input.ElementAt(0), typeof(T)), (T)Convert.ChangeType(input.ElementAt(1), typeof(T)), (T)Convert.ChangeType(input.ElementAt(2), typeof(T)), (T)Convert.ChangeType(input.ElementAt(3), typeof(T)));
        }
        public static IEnumerable<T> ReadLineNTimes<T>()
        {
            var input = new List<T>();
            var N = long.Parse(Console.ReadLine());
            for (int i = 0; i < N; i++)
            {
                input.Add((T)Convert.ChangeType(Console.ReadLine(), typeof(T)));
            }
            return input;
        }
        public static IEnumerable<T> ReadLineNTimes<T>(long N)
        {
            var input = new List<T>();
            for (int i = 0; i < N; i++)
            {
                input.Add((T)Convert.ChangeType(Console.ReadLine(), typeof(T)));
            }
            return input;
        }
        public static IEnumerable<T> ReadLineNTimes<T>(int N)
        {
            var input = new List<T>();
            for (int i = 0; i < N; i++)
            {
                input.Add((T)Convert.ChangeType(Console.ReadLine(), typeof(T)));
            }
            return input;
        }

        private int SolveDynamicProgramming(int n, IEnumerable<int> valueList)
        {
            var inputList = valueList.ToList();
            var dpList = new List<int>() { 0 };
            for (int i = 0; i < n; ++i)
            {
                dpList.Add(Math.Max(dpList[i], dpList[i] + inputList[i]));
            }

            return dpList[n];
        }

        private int SolveDynamicProgrammingForKnapsack(int n, int weight, List<int> valueList, List<int> weightList)
        {
            var dpList = new List<List<int>>();

            for (int i = 0; i < n + 1; ++i)
            {
                dpList.Add(Enumerable.Repeat(0, weight + 1).ToList());
            }

            for (int i = 0; i < n; ++i)
            {
                for (int w = 0; w <= weight; ++w)
                {
                    if (w >= weightList[i])
                    {
                        dpList[i + 1][w] = Math.Max(dpList[i][w - weightList[i]] + valueList[i], dpList[i][w]);
                    }
                    else
                    {
                        dpList[i + 1][w] = dpList[i][w];
                    }
                }
            }

            return dpList[n][weight];
        }

        public static int Gcd(int a, int b)
        {
            Func<int, int, int> gcd = null;
            gcd = (x, y) => y == 0 ? x : gcd(y, x % y);
            return a > b ? gcd(a, b) : gcd(b, a);
        }

        public static IEnumerable<bool[]> BitFullSearch(int n)
        {
            if (n <= 0)
            {
                yield return new bool[] { };
                yield break;
            }

            for (int i = 0; i < Math.Pow(2, n); i++)
            {
                var array = new bool[n];
                for (int j = 0; j < n; j++)
                {
                    var targetBit = (i >> j) & 1;
                    if (targetBit == 1) array[j] = true;
                }

                yield return array;
            }
        }

    }
}