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 Y%2 == 0 and 2*X<=Y<=4*X:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = 3, 8

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def ans170(X:int, Y:int):
    if Y<=X*4 and Y>=X*2 and Y%2==0:
        return("Yes")
    else:
        return("No")

print(ans170(X,Y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
low = a*2
high = a*4
if b%2 != 0:
  print("No")
elif b<low or b>high:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

a = 2*x-y/2
b = y/2-x
if a.is_integer() and b.is_integer() and a >= 0 and b >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main(heads, foots):
    """
    - foots != odd
    - 2*heads <= foots <= 4*heads
    """
    if foots%2 == 1:
        return 'No'
    else:
        if 2*heads <= foots <= 4*heads:
            return 'Yes' 
        else:
            return 'No'

if __name__ == '__main__':
    heads, foots = map(int, input().split())
    ans = main(heads, foots)
    print(ans)

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

ans = 'No'

#足が偶数であること
if Y%2 ==0:
    for i in range(X + 1):
        if (i * 2) + ((X - i) * 4) == Y:
            ans = 'Yes'
            break

print(ans)

Submission status: Accepted

Solution code:
N, A = list(map(int, input().split()))

flag = False
for i in range(N+1):
  count = i * 2 + (N - i) * 4
  if count == A:
    flag = True

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':

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

	for i in range(0,x+1):
		for j in range(0,y+1):
			if i + j == x and 2*i + 4*j == y:
				flg = True
				break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if y % 2 != 0:
    ans = "No"
elif (y >= 2*x) and (y <= 4*x):
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

if ((4*x-y)%2==0 and (-2*x+y)%2==0) and (1<=(4*x-y)//2<=100 and 1<=(-2*x+y)//2<=100):
    print('Yes')
elif ((4*x-y)%2==0 and (-2*x+y)%2==0) and (1<=(4*x-y)//2<=100 and (-2*x+y)//2==0):
    print('Yes')
elif ((4*x-y)%2==0 and (-2*x+y)%2==0) and ((4*x-y)//2==0 and 1<=(-2*x+y)//2<=100):
    print('Yes')
else :
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

X, Y = map(int,input().split()) #X_動物の数　Y_脚の数


ALL = X*2
for i in range(X+1):
    if ALL == Y:
        print('Yes')
        sys.exit()
    
    ALL += 2

print('No')

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
if Y%2!=0:
    print('No')
elif Y/2<X or Y/4>X:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

high = x*4
low = x*2

if low <= y <= high and y % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'No'

for crane in range(X + 1):
    turtle = X - crane

    if 2*crane + 4*turtle == Y:
        ans = 'Yes'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split());print(('No','Yes')[2*x<=~y%2*y<=4*x])

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print(('No','Yes')[2*x<=y<=4*x and -~y%2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 170 B
X , Y = list(map(int, input().split()))
ans = 0
for i in range(0, X+1):
    if (X-i)*2 + i*4 == Y:
        ans = 1
        
print('Yes') if ans == 1 else print('No')

Submission status: Accepted

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

def check():
  for i in range(x+1):
    k = x - i
    n = i * 2 + k * 4
    if n == y:
      return True
  return False

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

def f():
    for turu in range(X + 1):
        if 2 * turu + 4 * (X - turu) == Y:
            return "Yes"
    return "No"

print(f())

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ans = False
 
for i in range(101):
	for j in range(101):
		if i+j == x and 2*i+4*j == y:
			ans = True
if ans:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

max_Y = 4 * X
min_Y = 2 * X
if max_Y < Y:
    print("No")
    exit()

y = max_Y
while y >= min_Y:
    if y == Y:
        print("Yes")
        exit()
    else:
        y -= 2
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = [int(x) for x in input().split()]
total, ashi = l[0], l[1]

if ashi/2 != int(ashi/2):
    print('No')
else:
    if total <= ashi/2:
        if 2*total >= ashi/2:
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

for t in range(101):
    for k in range(101):
        if t+k == X and 2*t + 4*k == Y:
            ans = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = input().split()
x = l[0]
y = int(l[1])

ans = 0

foots = 2*int(x)

for i in  range(int(x)+1):
    if foots == y:
        ans +=1
    foots += 2

if ans == 1:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    X, Y = list(map(int, input().split()))
    for t in range(X+1):
        k = X - t
        if 2*t + 4*k == Y:
            print("Yes")
            return
    print("No")

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=0
for i in range(a+1):
  if 2*i+4*(a-i)==b:
    c=c+1
if c==0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
noA, noL = list(map(int, input().split()))

ans = "No"

for i in range(noA+1):
    for j in range(noA+1):
        if (i+j) == noA:
            if ((i*2)+(j*4)) == noL:
                ans = "Yes"
                break
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())

K = Y*0.5-X
T = 2*X - Y*0.5

if 0<= T and T == T//1 and 0<= K and K == K//1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
if Y - 2*X >= 0 and 4*X - Y >= 0 and (Y - 2*X) % 2 == 0 and (4*X - Y) % 2 == 0:
    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:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0

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

if cnt==0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = 0

for i in range(101):
    for j in range(101):
        if i+j == x:
            if 2*i+4*j == y:
                print("Yes")
                flag += 1
                break
    else:
        continue
    break

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

Submission status: Accepted

Solution code:
X, Y = [int(v) for v in input().split()]

ans = "No"
for c in range(X + 1):
    t = X - c
    if 2 * c + 4 * t == Y:
        ans = "Yes"
        break
# if ans == "No":
#     for t in range(X + 1):
#         c = X - t
#         if 2 * c + 3 * t == Y:
#             ans = "Yes"
#             break

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

a, b = map(int, input().split())
if b % 2 == 0 and a * 2 <= b and b <= a * 4 :
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


X, Y = list(map(int, input().split()))
Turtle = (Y - 2*X ) / 2
Crane = X - Turtle
if Turtle >= 0 and Crane >= 0 and is_integer(Turtle) and is_integer(Crane):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = list(map(int, input().split()))
judge = 0
for a in range(X + 1):
  if (Y - a*2 - (X-a)*4 ) == 0:
    print("Yes")
    judge = 1
if judge == 0:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
Max = X*4
while Max >= X*2:
  if Max == Y:
    print('Yes')
    exit()
  Max -= 2
print('No')

Submission status: Accepted

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


for i in range(x+1):
  turu = i
  kame = x-i
  if 2 * turu + 4 * kame == y:
    print("Yes")
    break
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:
    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 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())
if Y % 2 == 1:
    print("No")
    exit(0)
if 0 <= 2 * X - Y / 2 <= X:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
import numpy.linalg as linalg 

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

if Y%2 == 1:
  print('No')
else:
  A = np.array([[1, 1],
                [2, 4]])
  A_inv = linalg.inv(A)

  B = np.array([X , Y])

  C = np.dot(A_inv, B)
  if C[0] >= 0 and C[1] >= 0 :
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

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

print('Yes')

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=[int(i) for i in input().split()]
ans=0
for turu in range(x+1):
  kame=x-turu
  if turu*2+kame*4==y:
    ans=1
if ans==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

flg = False
for c in range(x+1):
    t = x-c
    flg |= y == (2 * c + 4 * t)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y= input().split()
IX = int(X)
IY = int(Y)
C = 2
T = 4
i = 0

while i <= IX:
    

    
    if ((C*i) + (T*(IX-i))) == IY:
        print('Yes')
        break
    elif i == IX:
        print('No')
        break
    else:
        i = i + 1

Submission status: Accepted

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

bx2 = Y - 2*X
a = X - bx2/2

if bx2 >= 0 and bx2 % 2 == 0 and a >=0:
    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:
x,y=map(int,input().split())
ans=0
for n in range(x+1):
  if n*2+(x-n)*4==y:
    ans=1
    break
if ans==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

if y > x * 4:
    print("No")
else:
    for i in range(x + 1):
        if 2 * i + 4 * (x - i) == y:
            str = 'Yes'
            break
        else:
            str = 'No'

    print(str)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
X,Y = map(int,input().split())

turtle_leg = 4
crane_leg = 2

for i in range(X+1):
  if Y == turtle_leg*i+crane_leg*(X-i):
    print ("Yes")
    break
  if i==X:
    print ("No")
    break

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
ans = 0
for i in range(X+1):
  if 2 * i + 4 * (X - i) == Y:
    ans += 1

print( "Yes" if ans > 0 else "No")

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x,y=map(int,input().split());print('NYoe s'[x*2<=~y%2*y<=x*4::2])

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print('YNeos'[y&1 or x*2>y or y>x*4::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

# 全ての組を探索すればよい
ans = 'No'
for i in range(X+1):
  if 2*i + 4*(X-i) == Y:
    ans = 'Yes'
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
print("YNeos"[1 - (x * 2 <= y <= x * 4 and y % 2 == 0)::2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def sol():
    x, y = map(int, input().split())
    for i in range(x+1):
        for j in range(x+1):
            if (i+j) == x and 4*i + 2*j == y:
                print("Yes")
                return
    print("No")

if __name__ == "__main__":
    sol()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x, y = (int(a) for a in input().split())
foot = 0
y_tmp = y
y_tmp2 = y

for i in range(x):
    y_tmp -= 2 * i + 4 * (x - i)
    y_tmp2 -= 4 * i + 2 * (x - i)
    if y_tmp == 0 or y_tmp2 == 0:
        print('Yes')
        exit()
    else:
        y_tmp = y
        y_tmp2 = y

print('No')

Submission status: Accepted

Solution code:
x, y = [int(n) for n in input().split(' ')]
crane_cnt = 0
found = False
while crane_cnt <= x:
    turtle_cnt = x - crane_cnt
    if (crane_cnt * 2 + turtle_cnt * 4) == y:
        found = True
        break
    crane_cnt += 1
print('Yes' if found else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def test():
    x, y = map(int, input().split())
    if y&1:
        print("No")
        return
    print("Yes" if 2*x<=y<= 4*x else "No")
test()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from itertools import chain

# from itertools import combinations as comb
# form bisect import bisect_left, bisect_right, insort_left, insort_right
# from collections import Counter
# import numpy as np

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):
    if Y % 2 == 1:
        return NO
    if Y > X * 4:
        return NO
    if Y < X * 2:
        return NO
    return YES


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    answer = solve(X, Y)
    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

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

flg = -1

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = list(map(int, input().split()))
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())
if x*2 <= y <= x*4 and y % 2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 'No'

for i in range(x+1):
    for j in range(y+1):
        if i + j > x:
            continue

        if i*2 + j*4 == y and i+j == x:
            ans = 'Yes'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

check = False
for i in range(0,X+1):
  for j in range(0,X+1):
    if i + j == X and 2*i + 4*j == Y:
      check = True
      
if check:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
num, leg = map(int, input().split())

ans = "No"
for i in range(num+1):
    leg2 = leg - 4 * i
    if leg2 % 2 == 0 and i + leg2 / 2 == num:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

for i in range(X+1):
  crane = (i)
  turtle = X-crane

  if crane*2 + turtle*4 == Y:
    print('Yes')
    break
  elif i == X:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = [int(v) for v in input().rstrip().split()]

r = 'No'
if Y % 2 == 0:
	for n in range(X + 1):
		cn = n
		tn = X - cn
		if cn * 2 + tn * 4 == Y:
			r = 'Yes'
			break

print(r)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 2*X-1/2*Y
y = -X + 1/2*Y

if x.is_integer() and y.is_integer() == True:
  if x >= 0 and y >= 0:
    print('Yes')
  else:
    print('No')
else:
  print('No')