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

Submission status: Accepted

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

turu = 4*X-Y
kame = Y-2*X

if turu % 2 == 0 and turu >= 0 and kame % 2 == 0 and kame >= 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()
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(0)
print('No')

Submission status: Accepted

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

for i in range(X+1):
    if 4*(i)+2*(X-i)==Y:
            b+=1
        
if not b==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):
  tu = i
  cr = x - i
  ch = tu*4 + cr*2
  if ch == y:
    ans = 'Yes'
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c="入力が間違っています。"
d="鶴が"
e="匹で、亀が"
f="匹です。"
 
k=b//2-a
t=2*a-b//2
if k<0 or t<0 or b%2!=0:
    print('No')
else:
    print('Yes')

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:
r=input().split()
X=int(r[0])
Y=int(r[1])
ans=0
for i in range(X+1):
    if 2*i==4*X-Y:
        print("Yes")
        ans+=1
        break
if ans==0:
    print("No")

Submission status: Accepted

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

flag=0
for i in range(x+1): #iは鶴の数
    if 2*i + 4*(x-i) == y:
        flag=1
        break

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

Submission status: Accepted

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

bool = False
for c in range(0, 101):
    for t in range(0, 101):
        if c + t == x and 2*t + 4*c == y:
            bool = True
            break
            
print('Yes' if bool else 'No')

Submission status: Accepted

Solution code:
x,y= map(int, input().split())
#条件が成り立つか判断
turu = 2*x - 0.5*y
kame = x - turu

if  turu >= 0 and kame >= 0 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')
else:
    for i in range(x + 1):
        foot = i * 2 + (x - i) * 4
        if foot == y:
            print('Yes')
            exit()
    print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y % 2 == 1:
    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())
z = 'No'
for i in range(x+1):
    if 2*i + 4*(x-i) == y:
        z = 'Yes'
        break
print(z)

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())
if (y%2 == 1):
  print("No")
else:
  if (y < x*2):
    print("No")
  elif (y > x*4):
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if y%2==1:
  print('No')
elif y>=2*x and y<=4*x:
  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 (X-i+1):
        if i*2 + j*4 == Y and i + j == X:
            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 (i * 2) + ((X-i) * 4) == Y:
        ans = 'Yes'

print(ans)

Submission status: Accepted

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

a = 0
ans = "No"

for a in range(0,X+1):
	if (a * 2)+((X-a) * 4)==Y:
		ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = 0
d = ["No","Yes"]

for i in range(a+1):
  if 2*(i+a) == b:
    c = 1 

print(d[c])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_line = input().split(" ")
X = int(input_line[0])
Y = int(input_line[1])
Pat = 0
for i in range(X + 1):
  C = i
  T = X - i
  Cf = C * 2
  Tf = T * 4
  F = Cf + Tf
  if Y == F:
      Pat = Pat + 1
if Pat > 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if (y % 2) != 0:
    print('No')
    exit()

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

Submission status: Accepted

Solution code:
def solve():
    X,Y = [int(i) for i in input().split()]
    if 2*X <= Y <= 4*X:
        if (4*X-Y) % 2 == 0:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t = list(map(int,input().split()))
 
m = 0
while m < n+1:
  if m*4 + (n-m)*2 == t:
    print('Yes')
    break
      
  m += 1
    
if m == (n+1):
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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())
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())
for a in range(0, X+1):
  if 2*X - Y/2 == a:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
if(m%2==1):
    print("No")
elif(2*n<=m and m<=4*n):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

x = 0
while x<=X:
  if Y == x*2 + (X-x)*4:
    print('Yes')
    break
  x+=1
else:
  print('No')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if b%2 != 0:
  print("No")
elif 2*a <= b and b <= 4*a:
  print("Yes")
else:
  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')
else:
  for i in range(0,X+1):
    if Y == (X * 2) + (i * 2):
      print('Yes')
      break
  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')
        exit()

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = [int(a) for a in input().split()]
head = float(inp[0])
leg = float(inp[1])

kame = (leg - head * 2) / 2
turu = head - kame

if kame == int(kame) and kame * turu >= 0:
  print ("Yes")
else:
  print ("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(x+1): #鶴の数
    if y == (i*2 + (x-i)*4):
        print('Yes')
        exit()

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

crane = 2*X - Y/2
turtle = Y/2 - X

print(['No', 'Yes'][crane >= 0 and turtle >= 0 and abs(crane) + abs(turtle) > 0 and Y % 2 == 0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
XY = input().split()
X = int(XY[0])
Y = int(XY[1])
l = []
for i in range(X+1):
    for j in range (X+1):
        if i + j == X:
            if (4*i + 2*j) == Y:
                l.append("Yes")
            else:
                l.append("No")
if l.count("Yes") > 0:
    print("Yes")
else:
    print("No")
        #print(str(i) + "," + str(j))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Crane and Turtle
X,Y=map(int,input().split())
def solve(X, Y):
    return (2*X - (1/2)*Y, -X + (1/2)*Y)
a, b = solve(X, Y)
ans = ['No', 'Yes'][((a>=0)&(b>=0))&((a%1==0)&(b%1==0))]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if y>=2*x and 4*x>=y and y%2==0:
    print('Yes')
else:
    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 2*a + 4*b == y:
        ans = 'Yes'
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if Y%2 ==0:
    if a >= 0 and b >= 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if X * 4 >= Y and X * 2 <= Y and Y%2 == 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())
number=0
for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        number += 1
    else:
        number += 0
if number > 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

n = int((y-2*x)/2)
m = int((4*x-y)/2)

if x == m+n and m >= 0 and n >= 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):
        legs = 4*i+2*(x-i)
        
        if legs == y:
            ans = 'Yes'
            break

    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(0, x + 1):
  # i is the number of the crane
  rest = y - (2 * i)
  if rest / 4 == x - i:
    print('Yes')
    ans = 1
    break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
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())
r=0
for i in range(0,x+1):
    c=i
    t=x-c
    if c*2+t*4==y:
        r=r+1
if r!=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
lst = []
ans = 'No'

for i in range(x):
  lst.append(2)

for i in range(x):
  if sum(lst) == y:
    ans = 'Yes'
    break
  lst[i] = 4
    
if sum(lst) == y:
    ans = 'Yes'
    
print(ans)

Submission status: Accepted

Solution code:
x=input()
lst=x.split(" ")
lstr=[]
for a in lst:
    lstr.append(int(a))
X=lstr[0]
Y=lstr[1]
if(Y%2==1):
    print('No')
else:
    if(Y/X<=4 and Y/X>=2):
        print('Yes')
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

def solve(x,y):
    legs = x * 2
    while(legs <= x * 4):
        if legs == y:
            print('Yes')
            return
        legs += 2
    print('No')
    return

solve(x,y)

Submission status: Accepted

Solution code:
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 != 0:
  print("No")
  exit()
elif 4 * x < y:
  print("No")
  exit()
elif 2 * x > y:
  print("No")
  exit()

print("Yes")

Submission status: Accepted

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

turu=X
kame=0
Flag=False
while turu>=0:
  total=4*turu+2*kame
  if total==Y:
    Flag=True
    break
  else:
    turu+=-1
    kame+=1
print("Yes" if Flag is True else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
given = input()

data = given.strip().split()
X = int(data[0])
Y = int(data[1])

i = 0
ashi = 0
while (i <= X):
    ashi = 2 * (X - i) + 4 * i
    if ashi == Y:
        print("Yes")
        break
    i = i + 1

if i == X + 1 and ashi != Y:
    print("No")

Submission status: Accepted

Solution code:
import sys

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

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

print('No')

Submission status: Accepted

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

if gap < 0 or gap > min:
  print("No")
else:
  if gap % 2 == 0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

A  =(-y+4.0*x)/2.0
B = (y-2.0*x)/2.0

if A>=0 and B>=0 and A.is_integer() and B.is_integer():
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    x, y = map(int, input().split())
    for i1 in range(x + 1):
        if i1 * 2 + (x - i1) * 4 == y:
            print('Yes')
            sys.exit()
    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

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

# i = カメの数
for i in range(X + 1):
    if i * 2 + (X - i) * 4 == Y:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

Solution code:
# Crane and Turtle

X, Y = [int(i) for i in input().split()]

for t in range(0, X + 1):
    legs = 2 * (X + t)
    if Y == legs:
        a = 'Yes'
        break
    if Y < legs:
        a = 'No'
        break
else:
    a = 'No'

print(a)

Submission status: Accepted

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

l = []
c = 2 * x
l.append(c)
for nn in range(x):
    c += 2
    l.append(c)

flag = False
for ll in l:
    if ll == y:
        print("Yes")
        flag = False
        break

    else:
        flag = True

if flag:
    print("No")

Submission status: Accepted

Solution code:
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#つまりlist[i] < x となる i の個数
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#つまりlist[i] <= x となる i の個数
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！
x,y = MI()
c = 0
for i in range(0,x+1):
  if 2*(x-i)+4*i == y:
    c = 1
if c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import math

def main():
    x, y = map(int, input().split())
    b = (y - 2 * x) / 2
    a = x - b
    if a >= 0 and b >= 0 and a == int(a) and b == int(b):
        print('Yes')
    else:
        print('No')
    
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
a = (4*x-y)/2
b = (-2*x+y)/2
if a%1 == 0 and 0 <= a and b%1 == 0 and 0 <=b:
  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 (y - 2*i)%4 == 0 and (y -  2 * i)//4 == x - i:
    flag += 1
    print("Yes")
    break
if flag == 0:
  print("No")

Submission status: Accepted

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

def hantei(list):
    #a + b = X and 2a + 4b = Y が存在するか
    #条件1 1 <= a <= 100 and 1 <= b <= 100

    a = 0
    count = 0
    while a <=100:
        for b in range(101):
            if a + b == list[0] and 2 * a + 4 * b == list[1]:
                print("Yes")
                count = 1
                break
        a += 1
        if count == 1:
            break
        elif count == 0 and a >= 100:
            print("No")
            break 

hantei(A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if(2*c+4*b==Y and (Y-a)%2==0 and c>=0 and b>=0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = list(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())
print('Yes') if 0 <= (4 * x - y) / 2 <= x and (4 * x - y) % 2 == 0 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(0)

print("No")

Submission status: Accepted

Solution code:
xy = [int(s) for s in input().split()]
x = xy[0]
y = xy[1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
XY = [int(s) for s in input().split()]
X = XY[0]
Y = XY[1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
A = y//2
B = (x-A)
while A>-1:
    if y==2*A + 4*B:
        print("Yes")
        break
    A = A-1
    B = B+1
    if A==-1:
        print("No")

Submission status: Accepted

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

ans = "No"

for turtle in range(X+1):
  crain = X - turtle
  if 2 * crain + 4 * turtle == Y:
    ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
X, Y = map(int, input().split())
for i in range(X+1):
  j = X - i
  if 2*i+4*j == Y:
    print('Yes')
    sys.exit()
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())

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

Submission status: Accepted

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


if __name__ == "__main__":
    Qb()

Submission status: Accepted

Solution code:
M,N = map(int,input().rstrip().split(" "))
ans=False
for a in range(M + 1):
    b=M-a
    if 2 * a + 4 * b == N:
        ans=True
if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

def f(X, Y):
    for i in range(X + 1):
        for j in range(X + 1):
            kame = i
            tsuru = j
            if kame + tsuru == X and kame * 4 + tsuru * 2 == Y:
                return 'Yes'
    return 'No'

print(f(X, Y))

Submission status: Accepted

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

def f(X, Y):
    for i in range(X + 1):
        for j in range(X + 1):
            kame = i
            tsuru = j
            if kame + tsuru == X and kame * 4 + tsuru * 2 == Y:
                return 'Yes'
    return 'No'

print(f(X, Y))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main(X, Y):
    for n_crane in range(X + 1):
        n_turtle = X - n_crane
        y = n_crane * 2 + n_turtle * 4
        if y == Y:
            print('Yes')
            return
    print('No')


if __name__ == "__main__":
    X, Y = [int(s) for s in input().split(' ')]
    main(X, Y)

Submission status: Accepted

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

# kame = x - turu
# 2*turu + 4*kame = y
# 2*turu + 4*(x - turu) = y
#  -2*turu + 4x - y = 0
# turu = 2x - 1/2*y

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
flag = False
n, y = list(map(int, input().split()))
for i in range(0, n):
        if i*2 + (n-i) * 4 == y or i*4 + (n-i)*2 ==y:
            flag = True
            break

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

Submission status: Accepted

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

Submission status: Accepted

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