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 (Python):
animal,leg = [int(x) for x in input().split()]


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")

Solution (Python):
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()

Solution (Python):
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')

Solution (Python):



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

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


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

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):


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()

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

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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()

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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")

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

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

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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))



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
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  

X, Y = read_ints()



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

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

print('No')

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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()

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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')

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

if(a<0):
  print("No")
elif(4*x<y):
  print("No")
elif(x==y):
  print("No")
elif(y<x):
  print("No")
else:
  if(a%2==0):
    print("Yes")
  else:
    print("No")

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

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

crain = int((4 * x - y) / 2)
turtle = int((y - 2 * x) / 2)

if crain >= 0 and turtle >= 0:
    if x == crain + turtle:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

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

Solution (Python):
a,b=map(int,input().split())
if b%2==0 and 2<=b/a<=4:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

x, y = map(int, input().split())
crane_foot = 2
turtle_foot = 4
for i in range(0, x+1):
    j = abs(x - i)
    if crane_foot * i + turtle_foot * j == y:
        print('Yes')
        sys.exit()
print('No')

Solution (Python):
x,y=map(int,input().split())
c=y/2-x
d=2*x-y/2
if c>=0 and d>=0 and y%2==0:
    print('Yes')
else:
    print('No')

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



D =[]

for A in range(X+1):
    if 2*A + (4 *(X-A)) == Y:
        D.append(A)
        
if len(D)>= 1:
    print("Yes")
else:
    print("No")

Solution (Python):
x, y=input().split()

x, y=int(x), int(y)

out=[]

if x==1:
    if y in [2, 4]:
        print("Yes")
    else:
        print("No")
else:
    for i in range(x+1):
        j=x-i
        if 2*i+4*j==y:
            out.append("succeeded")
            break
        else:
            continue

    if "succeeded" in out:
        print("Yes")
    else:
        print("No")

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

Solution (Python):
def solve():
    X, Y = map(int, input().split())
    ans = 'No'
    for i in range(X+1):
        if 2*i+4*(X-i)==Y:
            ans = 'Yes'
    return ans
print(solve())

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

if Y % 2 == 1:
  print("No")
  
elif X*2>Y:
  print("No")
  
elif X*4<Y:
  print("No")
  
else:
  print("Yes")

Solution (Python):


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

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

Solution (Python):

if __name__ == "__main__":
  x, y = [int(a) for a in input().split()]
  t = 2
  k = 4
  cnt = 0
  ans = "No"
  for i in range(x+1):
    cnt += i * t
    cnt += (x - i) * k
    if cnt == y:
      ans = "Yes"
      break
    cnt = 0
  print(ans)

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

Solution (Python):

"""AtCoder Beginner Contest 170: B - Crane and Turtle
https://atcoder.jp/contests/abc170/tasks/abc170_b
"""


def main():
    X, Y = list(map(int, input().split()))

    b = (Y - (2*X)) / 2
    a = X - b
    

    if int(b) != b:
        print('No')
    elif a < 0 or b < 0:
        print('No')
    elif a == 0 and b == 0:
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()

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

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

Solution (Python):
num_input=input().split()   
x=int(num_input[0])
y=int(num_input[1])
ans="No"
n=-1
for i in range(x+1):
    n=n+1
    ans_num=n*2+(x-n)*4
    if ans_num==y:
        ans="Yes"
print(ans)

Solution (Python):
import sys

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

if Y%2==1:
  print('No')
  sys.exit()
if Y<2*X:
  print('No')
  sys.exit()
  

check=int((Y-2*X)/2)

if check<=X:
  print('Yes')
else:
  print('No')

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

a = x
b = 0
ans = 'No'
if y%2 != 0:
    pass
else:
    while a >= 0:
        c = a*2 + b*4
        if c == y:
            ans = 'Yes'
        a -= 1
        b += 1
print(ans)

Solution (Python):
str1 = input()

A = str1.split(" ")


all4 = int(A[0])*4
res = "No"

for i in range(0, int(A[0])+1):
    if all4 == int(A[1]):
        res = "Yes"
        break
    else:
        all4 = all4 - 2
        
print(res)

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

x = 0
T = 4 * X - Y
while True:
    if T == 2 * x and X - x >= 0:
        print('Yes')
        exit()
    if T < 2 * x:
        print('No')
        exit()
    x += 1

Solution (Python):
import sys
X, Y = map(int, input().split())

low = X * 2
high = X * 4

if  Y % 2 != 0:
    print('No')
    sys.exit()

if Y >= low and Y <= high:
    print('Yes')
else:
    print('No')

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

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

else:
    print('No')

Solution (Python):
a = list(map(int,input().split()))
count = a[0] + 1
flag = ""

for i in range(count):
  if a[1] == 2*i + 4*(a[0]-i):
    flag = "OK"

print("Yes" if flag == "OK" else "No")

Solution (Python):
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')

Solution (Python):
num_ani, num_legs = [int(i) for i in input().split(" ")]

if num_legs % 2 == 0 and num_legs >= 2*num_ani and num_legs <= 4*num_ani:
  print("Yes")
else:
  print("No")

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

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

Solution (Python):
x, y = map(int, input().split())
a = (4 * x - y) / 2
b = (y - 2 * x) / 2
if ((a >= 0) & (b >= 0) & (a.is_integer() == True) & (b.is_integer() == True)):
  print('Yes')
else:
  print('No')

Solution (Python):
def Crane_and_Turtle():
    X, Y = map(int, input().split())

    turu = 2
    kame = 4

    k_num = int(Y / kame)

    while True:
        t_num = X - k_num

        asi = kame * k_num + turu * t_num

        if t_num >= 0 and k_num >= 0:       
            if asi > Y:
                k_num -= 1
            elif asi == Y:
                return 'Yes'
            elif asi < Y:
                return 'No'
        else:
            return 'No'

print(Crane_and_Turtle())

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


if __name__ == '__main__':
    main()

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

a = 4*x -y
b = y - 2*x
if a < 0 or b < 0 or y%2 == 1:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys
import itertools

input = sys.stdin.readline
x, y = map(int, input().split())
p = [2, 4]
for i in itertools.combinations_with_replacement(p, x):
    if sum(i) == y:
        print("Yes")
        exit()
print("No")

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

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

Solution (Python):
X , Y  =  map ( int , input().strip().split(" ") ) ;

r = -1 ;
for a in range ( 0, X + 1 ) :
	b = X -a ;
	if a * 2 + b * 4 == Y :
		r = 1 ;
		break ;
if r == -1 : 
	print ( "No") ;
else :
	print ("Yes" ) ;

Solution (Python):
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    x, y = map(int, readline().split())
    if 2 * x <= y <= 4 * x and y % 2 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
a = list(map(int, input().split()))
X =a[0]
Y =a[1]
for n in range(X+1):
    if 4*X-2*n ==Y :
        print("Yes")
        break
else:
    print("No")

Solution (Python):

from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce


MOD = 1000000007

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def combination(m,n):
    
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

def pow_k(x,n):  
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
    return K * x
    
def main():
    x,y = [int(x) for x in stdin.readline().rstrip().split()]
    if y % 2 == 0 and y >= 2*x and y <= 4*x:
        print("Yes")
    else:
        print("No")
main()

Solution (Python):
import sys
x,y = map(int,input().split())
if (y == 0):
  print('No')
  sys.exit()
for turu in range(x + 1):
  f = ( 4 * x - y ) / 2 
  if( int(f) == int(turu) and f.is_integer()):
    print('Yes')
    sys.exit()
print('No')

Solution (Python):
X,Y = map(int,input().split())
judge=0

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

if judge == 0:print("No")
else:print("Yes")

Solution (Python):
X,Y=map(int,input().split())
 
a=X*2
b=X*4
 
if Y<a or Y>b:
  print("No")
elif Y%2==1:
  print("No")
else:
  print("Yes")

Solution (Python):
x, y = map(int,input().split())
for i in range(101):
    for j in range(101):
        if i == j == 0:
            continue
        if (2*i + 4*j == y) and (i+j == x):
            print('Yes')
            exit()
print('No')

Solution (Python):
def b():
    X, Y = map(int, input().split())
    for x in range(X+1):
        if x * 4 + (X - x) * 2 == Y:
            print('Yes')
            return
    print('No')
    return



if __name__ == "__main__":
    b()

Solution (Python):
x,y = map(int,input().split())
ans ='No'

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

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

Solution (Python):
def main():
  X, Y = map(int, input().split()) 
  if Y % 2 == 1:
    print('No')
  else:
    if Y <= X * 4 and Y >= X * 2:
      print('Yes')
    else:
      print('No')
    
if __name__ == '__main__':
  main()

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

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

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

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

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

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

print(out)

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

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

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

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

Solution (Python):
X, Y = [int(x) for x in input().split()]
flag = True

if not 2*X <= Y <= 4*X:
  flag = False
if not 0 <= (Y-2*X)/2 <= X:
  flag = False
if (Y-2*X)/2.0 != int((Y-2*X)/2):
  flag = False
  
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):


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

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



if a>=0 and b>=0 and a%1!=0.5 and b%1!=0.5:
    print("Yes")
else:
    print("No")

Solution (Python):
def solve():
    X, Y = map(int,input().split())
    
    for crane in range(X+1):
        for turtle in range(X+1):
            if crane + turtle != X:
                continue

            if crane * 2 + turtle * 4 == Y:
                print('Yes')
                return
    else:
        print('No')

if __name__ == '__main__':
    solve()

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

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

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

Solution (Python):
def judge(num, legs):
  if legs % 2 != 0:
    return "No"
  elif legs // 4 > num:
    return "No"
  elif legs // 2 < num:
    return "No"
  elif (legs // 4) == num and (legs % 4) != 0:
    return "No"
  else:
    return "Yes"


list1 = input().split()
num = int(list1[0])
legs = int(list1[1])

print(judge(num, legs))

Solution (Python):
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))



X,Y = LI()

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

print('No')

Solution (Python):
import sys

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

turtle = x
for bird in range(x+1):
    if 4 * turtle + 2 * bird == y:
        print("Yes")
        sys.exit(0)
    turtle -= 1

print("No")

Solution (Python):
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys

sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    
    check=[False for _ in range(n)]
    check[s]=True
    
    queue=deque([s])
    visited_num=1

    
    
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        
        if len(queue)==0:
            
            
            return color

        now_vertex=queue.popleft()
        
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color




ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))




n,m=list(map(int,input().split()))
a=(m-2*n)/2
b=(4*n-m)/2

if a<0 or b<0 or int(a)!=a or int(b)!=b:
    print("No")
    exit()

else:
    print("Yes")

Solution (Python):
n,leg = map(int,input().split())
 
if leg%2==1:
    print('No')
elif 4*n < leg:
    print('No')
elif 2*n > leg:
    print('No')
else:
    print('Yes')

Solution (Python):
x, y = map(int, input(). split())
k = 0.5*y-x 
t = x - k
if y%2 == 0 and 0 <= k <= 100 and 0 <= t <= 100:
  print('Yes')
else:
  print('No')

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

Solution (Python):
X, Y = map(int, input().split())
count = 0
ans = 0

for i in range(X+1):
    count = 2*i + 4*(X-i)
    if(count == Y):
        ans = 1
        break
    else:
        ans = 2

if(ans == 1):
    print('Yes')
else:
    print('No')

Solution (Python):
x,y=(map(int,input().split()))
s=(4*x-y)/2.0
if s >= 0 and (s*10%10==0) and s <= x:
    print("Yes")
else:
    print("No")

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

ans = "No"
crane = 0
while crane <= x:
  turtle = x - crane
  if 2 * crane + 4 * turtle == y:
    ans = "Yes"
  crane += 1

print(ans)

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

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict



sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)


MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X, Y = il()
    for k in range(X + 1):
        if 2 * k + 4 * (X - k) == Y:
            print('Yes')
            exit()
    else:
        print('No')


if __name__ == '__main__':
    main()

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

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

a = (Y - 2 * X ) / 2
yMod = Y % 2
b = X - a
if yMod == 0:
  if a >= 0 and b >= 0 and (a != 0 or b != 0):
    print('Yes')
  else:
    print('No')
else:
  print('No')

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

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

Solution (Python):
A = [int(x) for x in input().split()]

x = A[0]
y = A[1]
check=0
 
for i in range(x+1):
  z = i*2+(x-i)*4
  if z==y:
    print("Yes")
    check+=1
if check==0:
  print("No")

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

if y<2*x or y >4*x:
    print("No")
    sys.exit()
else:
    for i in range(x+1):
        if y==4*x-2*i:
            print("Yes")
            sys.exit()
            
print("No")

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

count = 0

kame = 4
tsuru = 2

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

for i in range(0,X+1):
    if kame *i + tsuru*(X-i)==Y:
        count = 1
        
if count ==1:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
x,y=map(int,input().split())
num=2*x

for i in range(x+1):
  if num==y:
    print("Yes")
    sys.exit()
    
  num+=2
  
print("No")

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict, deque, Counter
from sys import exit
import math
import copy
from bisect import bisect_right

import sys
sys.setrecursionlimit(1000000)
import heapq
INF = 10**10

def dijkstra(graph, start, n):
    h = []
    heapq.heappush(h, (0, start))
    costs = [INF for _ in range(n)]
    while h:
     cost, cur = heapq.heappop(h)
     if costs[cur] != INF:
         continue
     costs[cur] = cost
     for edge in graph[cur]:
         ecost, tgt = edge
         if costs[tgt] == INF:
             heapq.heappush(h, (cost + ecost, tgt))

    return costs

def main():
    a, b = getList()
    if b >= 2 * a and b <= 4 * a and b % 2 == 0:
        print("Yes")
    else:
        print("No")
if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
import sys

X, Y = (int(item) for item in sys.stdin.readline().split())
print("Yes" if Y % 2 == 0 and X*2 <= Y and Y <= 4*X else "No")

Solution (Python):
totalNum, totalFoot = map(int, input().split())

if totalFoot <= totalNum * 4:
    flg = False
    for i in range(totalNum + 1):
        craneNum = i
        turtleNum = totalNum - i
        foot = (craneNum * 2) + (turtleNum * 4)

        if foot == totalFoot:
            flg = True
            print("Yes")
            break
    
    if not flg:
        print("No")
else:
    print("No")

Solution (Python):
x, y = map(int, input().split())
k = (y - 2*x)/2
t = (4 * x - y)/2
ans = "No"
if(k >= 0):
  if(k % 1 == 0):
    if(t >= 0):
      if(t % 1 == 0):
        ans = "Yes"
print(ans)