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.



Sample input:
3 8


Sample output:
Yes

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

if 4 * X < Y:
  print("No")
elif Y / 2 < X:
  print("No")
else:
  y = abs(Y - 2 * X)
  x = abs(4 * X - Y)
  if y%2 == 0 and x%2 == 0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def judge(x, y):
    if (x < 0 or x>100):
        return False
    if (y < 0 or y>100):
        return False
    if (x+y == 0):
        return False
    if (y%2):
        return False
    if x < y/4:
        return False
    if x*2 > y:
        return False
    return True

x, y = map(int, input().split())
if judge(x, y):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
i = 0
while i<=a:
  turu = 2*(a-i)
  kame = 4*i
  ans = turu + kame
  if ans == b:
    print('Yes')
    break
  i = i + 1
  
else:
  print('No')

Submission status: Accepted

Solution code:
i = input()
n = i.split(' ')

x = int(n[0])
y = int(n[1])
even = y % 2 == 0

xt = x * 2
xf = x * 4

if y > (x * 4) or not even:
  print('No')
elif y == 2 or y == 4:
  print('Yes')
elif y >= xt and y <= xf:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x,y = list(map(int, input().split()))
if y > 4*x:
  print("No")
else:
  if y % 2 == 0 and y >= x*2:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
x,y=map(int, input().split())
a=False

for i in range(0,x+1):
  if i*2+(x-i)*4==y:
    a=True
    break
    
if a==True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
X, Y = input().split()
x = int(X)
y = int(Y)
a = (4*x - y) / 2
b = (-2*x + y) / 2
if(a >= 0 and a.is_integer() and b >= 0 and b.is_integer()):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
ans = "No"
foots = 2*X
for tsuru in range(X+1):
    if foots == Y:
        ans = "Yes"
    foots += 2
    
    
print(ans)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())

flag = 0
for i in range(X+1):
    for j in range(X - i +1):
        if((2*i) + (4*j) == Y)&(i+j == X):
            flag = 1
if(flag == 1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

X, Y = map(int, input().split())

# a + b = X
# 2a + 4b = Y

for a in range(X + 1):
    b = X - a

    if (2 * a + 4 * b) == Y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
number = input().split()
number_int = [int(x) for x in number]
sum1 = number_int[0]
sum2 = number_int[1]
answer = 'No'

for i in range(sum1+1):
    temp1 = i * 2
    temp2 = (sum1 - i) * 4
    if temp1 + temp2 == sum2:
        answer = "Yes"
        break

print(answer)

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
a = y-2*x
if a%2!=0 or a < 0 or a/2>x:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
num = [int(s) for s in input().split()]
t_num = 0
k_num = 0
flag = False
for i in range(num[0]+1):
    t_num = i
    k_num = num[0] - t_num
    tmp = t_num * 2 + k_num * 4
    if tmp == num[1]:
        flag = True
if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x, y = [int(i) for i in input().split()]
a2 = 0
a4 = 0
flag =0

for k in range(x+1):
    a2 = 2*k
    a4 = 4*(x-k)
    y_t = a2 + a4
    
    if y_t == y:
        print('Yes')
        flag = 1

if flag == 0:
    print('No')

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
ans = 'No'
for a in range(X+1):
    for b in range(X+1):
        if a + b == X and 2*a + 4*b == Y:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
maxx = y//2 +1
maxxx = max(x,maxx) + 1
count = 0
for i in range(maxxx):
  for j in range(maxxx):
    if i + j == x and i*2 + j*4 == y:
      count += 1
if count == 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
from sys import stdin

x,y=[int(x) for x in stdin.readline().rstrip().split()]

exist=4*x
if 4*x >= y and y >= 2*x and y%2==0:
       print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())

s=x*4

if (s-y)%2==0 and s-y>=0:
    T=(s-y)/2
    K=x-T

    if K>=0 and T>=0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
import math
X, Y = map(int,input().split())
ans = "No"
for i in range(X+1):
  if(2*X+2*i==Y):
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

if 4*x >= y and 2*x <= y and y%2==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
X, Y=(int(x) for x in input().split())

if (2*X - Y/2) < 0 or (Y/2 - X) < 0 or Y%2 != 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
X,Y=input().split();
X=int(X);
Y=int(Y);
for k in range(X+1):
  if Y==4*k+2*(X-k):
    print("Yes");
    exit();
print("No");

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
x, y =map(int, input().split())


if x* 2 > y:
  print('No')
elif x * 4 < y:
  print('No')
elif y %2!=0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
X,Y = (int(x) for x in input().split())

A = []

for x in range(0,X+1,1):
    legs = 2 * x + 4 * (X-x)
    if legs == Y:
        A.append([x,X-x])

if len(A) == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for a in range(100):
    for b in range(100):
        if (a * 2) + (b * 4) == Y and a + b == X:
            print("Yes")
            exit(0)
print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

if 4 * X - Y < 0:
        print("No")
        exit()

if (4 * X - Y)  % 2 == 0:
        tsuru = (4 * X - Y) // 2
        if X - tsuru < 0:
                print("No")
                exit()
        kame = X - tsuru
        if kame * 4 + tsuru * 2 == Y:
                print("Yes")
                exit()
        else:
                print("No")
                exit()
else:
        print("No")
        exit()

Submission status: Accepted

Solution code:
import sys
import itertools
x, y = map(int, input().split())

turtle = [i for i in range(x+1)]
crane = [i for i in range(x+1)]

for t, c in itertools.product(turtle, crane):
    if (4*t + 2*c == y) and (t + c == x):
        print('Yes')
        sys.exit()

print('No')

Submission status: Accepted

Solution code:
x, y = list(map(int, input().split()))

crain = (4*x - y) / 2
kame = x - crain

if crain < 0 or kame < 0:
    print('No')
    exit()

if crain.is_integer() and crain > 0:
    print('Yes')
    exit()

if kame.is_integer() and kame > 0:
    print('Yes')
    exit()

print('No')

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
asi = y - (2*x)
if asi % 2 == 1 or asi < 0:
    print('No')
    exit()
t = asi // 2
if x - t < 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

if 2 * x <= y <= 4 * x and y % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI():return list(map(int,sys.stdin.readline().rstrip().split()))
def LS():return list(sys.stdin.readline().rstrip().split())

def main():
  X,Y = LI()[:]
  #print(X,Y)

  if ((Y-2*X) % 2) == 0:
    a = (Y-2*X) / 2
    if a<=X and a>=0:
      print('Yes')
      exit()
  
  print('No')

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
def test(X, Y): 
  x = (4*X - Y) / 2
  y = (Y - 2*X) / 2
  
  if (x >= 0 and x % 1 == 0 and
     y >= 0 and y % 1 == 0):
      print('Yes')
  else:
    print('No')
  
X, Y = input().split()
test(int(X), int(Y))

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y%2 == 0 and 2 <= y/x <= 4:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

# x, y = 3, 12
# yが奇数だと駄目
if y%2 == 1:
  print('No')
  exit()
# 全部亀だとしても少なかったらNo
# 全部鶴としても多かったらNo
if x*4 < y or x*2 > y:
  print('No')
  exit()

# ほぼ解が存在
print('Yes')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

a = 2*x - y/2
b = y/2 - x

if  a >= 0 and a % 1 == 0 and b >= 0 and b % 1 == 0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int,input().split())

# つる:a かめ:b

for a in range(101):
	for b in range(101):
		if a+b == x and 2*a+4*b==y:
			print('Yes')
			exit()

print('No')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())

a=(y-2*x)/2
b=(4*x-y)/2

if a.is_integer() and b.is_integer():
    if a<0 or b<0:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if Y % 2 == 0 and 2 * X <= Y <= 4 * X:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

flag = 0
for i in range(x+1):
  if (i * 2 + (x - i) * 4) == y:
    print("Yes")
    flag = 1
    break
if flag == 0:
  print("No")

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

a,b=ml()
legs=0
f=0
for i in range(a+1):
    if (i*2+(a-i)*4)==b:
        f=1

if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
if Y%2==1:
    print('No')
else:
    if 4*X>=Y>=2*X:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split(" "))
if y < 2 * x or 4 * x < y or y % 2 != 0:
    print("No")
    exit(0)
needed = (y - 2 * x) / 2
if needed > x:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
a= (4*X-Y)/2
b= (Y-2*X)/2
c = int(a)
d = int(b)

if a==c and b ==d and a>=0 and b >=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())

if Y>4*X or Y<2*X:
    print('No')
    exit()
else:
    pass

if (Y-2*X)%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x, y = map(int, open(0).read().split())
c = ((x * 2) <= y <= (x * 4)) and y % 2 == 0
if c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X, Y= map(int, input().split())
if (Y % 2) != 0:
  print('No')
elif (2 * X) > Y :
  print('No')
else:
  if (2 * X - Y /2 ) >= 0:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
numbers = [int(i) for i in input().split()]
if (4*numbers[0]-numbers[1])%2 == 0 and (4*numbers[0]-numbers[1]) >= 0 and (numbers[1]-2*numbers[0])%2 == 0 and (numbers[1]-2*numbers[0]) >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

for i in range(100):
    for j in range(100):
        if i+j == x and 2*i + 4*j == y:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())

A=(Y-2*X)/2
B=X-A

if (Y-2*X)%2==0:
    if A>=0 and B>=0 and A+B==X and 4*A+2*B==Y:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

a=b=0


if x*4<y or x*2>y:
    print('No')
    exit()

if (y-2*x)%2==0:
    n=(y-2*x)/2
    if x-b>=0:
        print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
if 2*X<=Y and Y<=4*X:
  if Y%2==0:
    print("Yes")
  if Y%2!=0:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
from functools import lru_cache
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7 

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    X, Y = read_values()
    for a in range(X + 1):
        if Y == a * 2 + (X - a) * 4:
            print("Yes")
            return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x, y = list(map(int,input().split()))

y_2x = y - (2 * x)

turtle = y_2x / 2
bird = x - turtle

if turtle >= 0 and bird >= 0 and bird.is_integer() and turtle.is_integer():
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if 2 * a <= b <= 4 * a and b % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y = [int(x) for x in input().split()]
if y % 2 != 0:
    print("No")
else:
    if y >= 2*x and y <= 4*x:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
wa, num = map(int, input().split())
kame = (num / 2) - wa
turu = wa - kame

if (kame >= 0 and turu >= 0) and (wa == kame + turu) and (num == 2 * turu + 4 * kame) and (
        kame.is_integer() and turu.is_integer()):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input().split()
X = int(N[0])
Y = int(N[1])

flag = False

for i in range(X):
    if flag:
        break

    if (X-i)*2 + i*4 == Y:
        flag = True
    
    if (X-i)*4 + i*2 == Y:
        flag = True

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for i in range(X + 1):
  if 2 * i + 4 * (X - i) == Y:
    ans = "Yes"
    break
  else:
    ans = "No"
print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
sub = y - x * 2
if sub % 2 == 0 and 0 <= sub / 2 <= x:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
b = (y/2-x)
a = x - b
if 2*a+4*b != y or y%2 or x*2 > y or x*4 < y:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
x,y=[int(x) for x in input().split()]
if y%2==0 and y>=2*x and y<=4*x: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:

def main():
    X, Y = map(int, input().split())
    #total X
    #feet Y
    for x in range(X+1):
        y = X - x
        feet = 4 * x + 2 * y
        if feet == Y:
            print("Yes")
            return

    print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if y%2!=0 or 2*x>y or 4*x<y:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
if y>=2*x and y<=4*x and y%2==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

ans = "Yes"
if y % 2 != 0:
  ans ="No"
elif y < x * 2:
  ans ="No"
elif (y - (x * 2) ) / 2 > x :
  ans = "No"

print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

def check():
    for i in range(0, X + 1):
        if i * 2 + (X - i) * 4 == Y:
            return 'Yes'
    return 'No'

print(check())

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
answer = []
for i in range(X):
    i += 1
    answer.append(i * 4 + (X - i) * 2)
    answer.append(i * 2 + (X - i) * 4)
if Y in answer:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# 別変数の整数複数個
X, Y = [int(x) for x in input().strip().split(" ")]

if Y % 2 == 1:
    print("No")
else:
    turtles = (Y - 2 * X) // 2
    cranes = (4 * X - Y) // 2
    if (0 <= turtles <= X) and (0 <= cranes <= X):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N, M = map(int,input().split())
crain = (4 * N - M) / 2
t = N - crain
if crain.is_integer() and crain > 0:
  if t.is_integer() and t >= 0:
    print("Yes")
  else:
    print("No")
elif t.is_integer() and t > 0:
  if crain.is_integer() and crain >= 0:
    print("Yes")
  else:
    print("No")
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

crain = (4 * X - Y) / 2

if crain.is_integer() and 0 <= crain <= X:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import os
import numpy as np

if os.path.exists('input.txt'):
    test_mode = True
else:
    test_mode = False

if test_mode:
    f = open('input.txt')
    
def get_input():
    if test_mode:
        return f.readline().rstrip()
    else:
        return input().rstrip()

input_line = get_input().split()
X = int(input_line[0])
Y = int(input_line[1])

kame = float((Y - 2*X)/2)
turu = float(X - kame)

if turu >= 0 and kame >= 0 and turu.is_integer() and kame.is_integer() :
    print('Yes')
else:
    print('No')

if test_mode:
    f.close()

Submission status: Accepted

Solution code:
x, y = map(int, input().split(" "))

for i in range(0, x+1):
    f = 2*i + 4*(x-i)
    if f == y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
a=y
a -= 2*x
if a < 0 or a > 2*x or a % 2 == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
c, z = map(int, input().split())
if(c >= z):
    print('No')
    exit()
x = (4 * c - z) / 2
yojo = (4 * c - z) % 2
y = c - x

if(x >= 0 and yojo == 0 and y >= 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

for i in range(X + 1):
    j  = X - i
    if i * 2 + j * 4 == Y:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
x, y = [int(x) for x in input().split()]

found = False

for i in range(x+1):
	if (2*i) + (4*(x-i)) == y:
		found = True
		break

print("Yes" if found else "No")

Submission status: Accepted

Solution code:
line = input()
line = line.rstrip().split(' ')

total = int(line[0])
total_leg = int(line[1])

kame = (total_leg - total * 2) / 2
tsuru = total - kame

if total_leg % 2 == 1:
    print('No')
elif (0 <= kame and kame <= total) and (0 <= tsuru and tsuru <= total):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

max = X * 4

if Y > max:
    print('No')
elif Y % 2 != 0:
    print('No')
else:
    for i in range(2*X, 4*X+1, 2):
        if i == Y:
            print('Yes')
            break
    else:
        print('No')

Submission status: Accepted

Solution code:
animal,leg = [int(x) for x in input().split()]
# crane + turtle = animal
# 2*crane + 4*turtle = leg
import numpy as np
A = np.array([
    [1,1],
    [2,4]
])
B = np.array([
    [animal],
    [leg]
])
A_inv = np.linalg.inv(A)
ans = A_inv.dot(B)
result = 0
for a in ans:
    for b in a:
        if b<0 or not b.is_integer():
            result = 1
            break
if result:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    X, Y = map(int, input().split())
    crane = (4*X-Y) / 2
    turtle = (-2*X + Y) / 2
    print("Yes") if crane.is_integer() and crane >= 0 and turtle.is_integer(
    ) and turtle >= 0 else print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X,Y = list(map(int, input().split()))
for n in range(X+1):
  ans = n*4 + (X-n)*2
  if ans == Y:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- Coding: utf-8 -*-

x, y = (int(x) for x in input().split())

c = 4 * x - y
t = y - 2 * x

#print(c,t)
if c % 2 == 0 and t % 2 == 0:
    if c < 0 or t < 0:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y =map(int,input().split())
if ((y-2*x)%2==0 and (y-2*x)/2 >= 0 and (y-2*x)/2 <= x):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from numpy.linalg import solve

x, y = map(int, input().split())
left = [[1, 1],
        [2, 4]]

right = [x, y]

a = solve(left, right)

left = [[1, 1],
        [4, 2]]

right = [x, y]
b = solve(left, right)
if (a[0] >= 0 and a[1] >= 0) or (b[0] >= 0 and b[1] >= 0):
    if (a[0].is_integer() is True and a[1].is_integer() is True) or (b[0].is_integer() is True and b[1].is_integer() is True):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y = list(map(int,input().split()))
if y > 4*x:
    print("No")
elif y < x*2:
    print("No")
elif y % 2 == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

import sys

def main():
    x,y = map(int,input().split())

    if x >= y:
        print("No")

    else:
        for crane in range(x+1):
            for turtle in range(x+1-crane):
                if crane+turtle==x and 2*crane+4*turtle==y:
                    print("Yes")
                    sys.exit()
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
if y%2 != 0:
    print('No')
elif 2*x <= y <= 4*x:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map( int, input().split() )
 
ret = True
if (4 * X  - Y) % 2 == 1:
  ret = False
if 4 * X  - Y < 0:
  ret = False
if (Y - 2 * X) % 2 == 1:
  ret = False
if Y - 2 * X < 0:
  ret = False
if ret:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
X = A[0]
Y = A[1]  

if Y % 2 == 0:
  YY = Y / 2
  if ((YY - X) >= 0):
    if ((2 * X - YY) >= 0):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
for i in range(x+1):
  if y == (2*i + 4*(x-i)):
    print("Yes")
    break
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    X, Y = map(int, input().split())

    d, m = divmod((X * 4 - Y), 2)
    if 0 <= d <= X and not m:
        print('Yes')
    else:
        print('No')


main()

Submission status: Accepted

Solution code:
import sys
def ints(): return map(int,sys.stdin.readline().rstrip().split())
x, y = ints()
if (2 * x <= y <= 4 * x) and (y % 2 == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
tf = False
tf = False if x * 4 < y or x * 2 > y else True
if tf:
  print('Yes' if y % 2 == 0 else 'No')
else:
  print('No')

Submission status: Accepted

Solution code:
xy = input().split()
b = [int(a) for a in xy]

turu = 0
kame = 0

coeff = [[1, 1],[2,4]]
c = (coeff[0][0]*coeff[1][1]-coeff[0][1]*coeff[1][0])


inv_coeff = [[coeff[1][1]/c,-coeff[0][1]/c],[-coeff[1][0]/c,coeff[0][0]/c]]

turu = b[0]*inv_coeff[0][0]+b[1]*inv_coeff[0][1]
kame = b[0]*inv_coeff[1][0]+b[1]*inv_coeff[1][1]


if turu < 0 or kame < 0:
    print('No')
elif not turu.is_integer() or not kame.is_integer():
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

flag = 0

for i in range(0, x + 1):
    if i * 2 + (x - i) * 4 == y:
        flag = 1
        break

if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

if Y % 2 == 0 and Y >= 2*X and Y <= 4*X:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

x, y = map(int, input().split())
if y < 2:
  print("No")
else:
  if y % 2 == 0:
    turtle = y / 2 - x
    crane = x - turtle
    if not is_integer(turtle) or crane < 0 or turtle < 0:
      print("No")
    else:
      print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
import sys

x, y = map(int, input().split())

if y % 2 == 1:
    print('No')
    sys.exit()

for i in range(x+1):
    if y == i*2 + (x-i)*4:
        print('Yes')
        sys.exit()

print('No')

Submission status: Accepted

Solution code:
s=input().rstrip().split(' ')
x=int(s[0])
y=int(s[1])
ans=2*x-y/2
if(ans>=0 and ans<=x and y>=2*x and ans.is_integer()):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
for i in range(x+1):
  f = 2 * i + 4 * (x - i)
  if f == y:
    print("Yes")
    exit()

print("No")

Submission status: Accepted

Solution code:
x,y  = map(int,input().split())
hon = 0
flag = False
for i in range(1,x+1):
    turu = i
    kame = x - i

    hon=2*turu+4*kame
    if hon == y:
        flag = True
        
for i in range(1,x+1):

    turu = x-i
    kame = i 

    hon=2*turu+4*kame
    if hon == y:
        flag = True
    
if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
ans="No"
if X<=50:
    for i in range(X+1):
        if i*2+(X-i)*4==Y:
            ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if Y%2==0 and Y/2 -X >= 0 and 2*X-Y/2>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

num_kame = (Y - 2*X)/2
num_tsuru = (4*X - Y)/2

if (num_kame >= 0) and (num_tsuru >= 0) and (num_kame.is_integer()) and (num_tsuru.is_integer()) and (X == num_kame+num_tsuru):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def read_a_int(): return int(read())


def read_ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

X, Y = read_ints()

# x...つるの数
# y...亀の数
for x in range(X + 1):
    y = X - x
    if Y == y * 4 + 2 * x:
        print('Yes')
        exit()
print("No")

Submission status: Accepted

Solution code:
x,y=map(int, input().split())
for t in range(x+1):
    if 2*t+4*(x-t)==y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

for i in range(101):
    for j in range(101):
        if i + j == x:
            if 2 * i + 4 * j == y:
                print('Yes')
                exit()

print('No')

Submission status: Accepted

Solution code:
input_line = input().split(" ")
X=int(input_line[0])
Y=int(input_line[1])
Z=4*X-Y
H=Z/2
R=X-H

if H<0 or 2*X>Y:
  print("No")
elif int(H)+int(R)==X and int(2*H)+int(4*R)==Y:
  print("Yes")
  
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

(x, y) = list(map(int, input().split()))

tutle = x
while(tutle >= 0):
    v = tutle * 4 + (x - tutle) * 2
    if(v == y):
        print('Yes')
        sys.exit()
    tutle -= 1
print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

if (Y%2 == 1):
  print("No")
elif (Y > (X*4)):
  print("No")
else:
  yes = False
  for i in range(0,X+1):
    fNum = i
    tNum = X-i
    if ((fNum*4)+(tNum*2)==Y):
      print("Yes")
      yes = True
  if not (yes):
    print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())

fits=y/4

if y%2!=0:
  print('No')
  exit()
  
if fits==x:
  print("Yes")
  exit()
if fits<=x<=y/2:
  print("Yes")
  exit()
print('No')

Submission status: Accepted

Solution code:
X, Y = input().split()

X = int(X)
Y = int(Y)

if (2*X > Y) or (4*X < Y):
    print("No")
    exit()
elif(Y % 2 != 0):
    print("No")
    exit()


for kame in range(0, 26):
    for tsuru in range(0, 51):
        if(tsuru * 2 + kame * 4) == Y:
            print("Yes")
            exit()
    
print("No")
exit()

Submission status: Accepted

Solution code:
total_num, reg_total = map(int, input().split())

crane_num = 2*total_num - reg_total/2
turtol_num = total_num - crane_num + 0.0

if crane_num.is_integer() and crane_num >= 0 and \
        turtol_num.is_integer() and turtol_num >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
j=0
for i in range(Y//4+1):
  if i<=X:
    if 4*i+2*(X-i)==Y:
      j+=1
if j==0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
flag=False

for i in range(X+1):
  if i*4+(X-i)*2==Y:
    flag=True

if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
a=(y-(2*x))/2

if y%2!=0:
    print('No')
elif (2*x)>y:
    print('No')
elif a<=x:
    print('Yes')    
else:
    print('No')