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: Wrong Answer)

using System;
using System.Globalization;
using System.IO;
using System.Text;

public class Program
{
    public static void Main(string[] args)
    {
        var stdin = Console.OpenStandardInput();
        var ss = new StreamScanner(stdin);
        var p = new Program();
        p.solve(ss);
        stdin.Close();
    }

    private void solve(StreamScanner ss)
    {
        var x = ss.Int;
        var y = ss.Int;
        var t = 0;
        var k = 0;

        for (t = 0; t + k <= x; ++t)
        {
            for (k = 0; t + k <= x && calcLegs(t, k) <= y; ++k)
            {
                if (calcLegs(t, k) == y)
                {
                    Console.WriteLine("Yes");
                }
            }
        }
        Console.WriteLine("No");
    }

    private int calcLegs(int tsuru, int kame) => 2 * tsuru + 4 * kame;


    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        private readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) throw new EndOfStreamException();
            if (ptr >= len)
            {
                ptr = 0;
                if ((len = str.Read(buf, 0, 1024)) <= 0)
                {
                    isEof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }
        public char Char
        {
            get
            {
                byte b = 0;
                do b = read();
                while (b < 33 || 126 < b);
                return (char)b;
            }
        }

        public string Scan
        {
            get
            {
                var sb = new StringBuilder();
                for (var b = Char; b >= 33 && b <= 126; b = (char)read())
                    sb.Append(b);
                return sb.ToString();
            }
        }

        public long Long
        {
            get
            {
                long ret = 0; byte b = 0; var ng = false;
                do b = read();
                while (b != '-' && (b < '0' || '9' < b));
                if (b == '-') { ng = true; b = read(); }
                for (; true; b = read())
                {
                    if (b < '0' || '9' < b)
                        return ng ? -ret : ret;
                    else ret = ret * 10 + b - '0';
                }
            }
        }

        public int Int => (int)Long;

        public int[] IntArray(int n)
        {
            var arr = new int[n];
            for (var i = 0; i < n; ++i)
            {
                arr[i] = Int;
            }
            return arr;
        }

        public double Double => double.Parse(Scan, CultureInfo.InvariantCulture);
    }
}