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:
import sys
input = sys.stdin.readline
import math

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*x) % 2 == 0 and (y - 2*x) >= 0 and (4*x - y) >= 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:
def main():
    x , y = map(int,input().split())
    var2=x
    var4=0
    for loop in range(x+1):
        roger = (2*var2) + (4*var4)
        if roger == y:
            return "Yes"
        var2-=1
        var4+=1
    return "No"
print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(Ans)

Submission status: Accepted

Solution code:
a,b = map(int , raw_input().split())
"""
print a,b

x + y = a
2x + 4y = b 

y = a - x
2x + 4a - 4x = b

y = a - x
-2x = b - 4a
"""

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

print 'Yes' if x + y == a and 2*x + 4 * y == b and x >= 0 and y>=0 else 'No'

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
list_foot=[]
for i in range(0,x+1):
  list_foot.append(2*i+4*(x-i))
  
answer=sum(z==y for z in list_foot)  

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict


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

Submission status: Accepted

Solution code:
from numpy.linalg import solve
x, y = map(int, input().split())
c, t = solve([[1, 1], [2, 4]], [x, y])
print('Yes' if (c>=0 and t>=0 and c%1==0 and t%1==0) else 'No')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list1=(input()).split()
X=int(list1[0])
Y=int(list1[1])
x=2*X-Y/2
y=-X+Y/2
if x.is_integer() and y.is_integer() and x>=0 and y>=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 Y%2==0 and Y-2*X>=0 and 4*X-Y>=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'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########

def resolve():
    x,y = mi()
    minval = x * 2
    maxval = x * 4
    invalid  = 1
    if minval<= y and y <= maxval and y%2 == 0:
        invalid = 0
    print("No" if invalid else "Yes")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
data = stdin.readline().rstrip()

x = int(data.split()[0])
y = int(data.split()[1])

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

Submission status: Accepted

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

if t < 0 or t%1 != 0 or x < t:
    print("No")
else:
    print("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())

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#170B
#Crane and Turtle

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if a>=0 and b>=0 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(101):
    for j in range(101):
        if i + j == X and i * 2 + j * 4 == Y:
            ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	a,b = map(int,input().split())
	av = 0
	for kame in range(101):
		for tsuru in range(101):
			if kame + tsuru == a and 4*kame + 2*tsuru == b:
				print("Yes")
				av = 1
				break
	if av == 0:
		print("No")
	


if __name__ == '__main__':
	main()

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:
stdins = input().split()
x = int(stdins[0])
y = int(stdins[1])

ans = "No"
for n_tr in range(0, x + 1):
    n_km = x - n_tr
    if y == n_tr*2 + n_km*4:
        ans = "Yes"
        break

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

if (Y/2).is_integer() and Y/2-X >= 0 and 2*X-Y/2 >= 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys

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

for turu in range(x+1):
    leg = turu*2 + (x-turu)*4
    if y == leg:
        print("Yes")
        sys.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())

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

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 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())
f = False
for a in range(x+1):
  b=x-a
  if 2*a + 4*b == y:
    if not f:
      print("Yes")
      f = True

if not f:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=input().split()
x
mat="No"
for i in range (0,101):
    for j in range(0,101):
        if i*2+j*4==int(y) and i+j==int(x):
            mat="Yes"

print(mat)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a = (4*n - m) / 2;
b = n - a;
if(m % 2  == 1 or a < 0 or b < 0): print("No")
else: print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

X,Y = list(map(int, input().rstrip().split()))
#-----
crane = (4*X - Y) / 2
tortoise = (-2*X + Y) / 2

if (crane == tortoise == 0) or \
   (crane % 1 != 0) or (tortoise % 1 != 0):
    print("No")
    sys.exit()

if (0 <= crane <= 100) and (0 <= tortoise <= 100):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
import sys
input = lambda: sys.stdin.readline().strip()
x, y = [int(x) for x in input().split()]
print('Yes' if any(c * 2 + (x - c) * 4 == y for c in range(x + 1)) else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

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

tf = False
for a in range(X + 1):
  b = X - a
  if a * 2 + b * 4 == Y:
    tf = True
    break

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

Submission status: Accepted

Solution code:
animals_num, legs_num = map(int, input().split())

answer = "No"

for i in range(animals_num + 1):
  j = animals_num - i
  if j * 4 + i * 2 == legs_num:
    answer = "Yes"
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

x = xy[0]
y = xy[1]

exist = False
for i in range(x + 1):
  if 2 * i + 4 * (x - i) == y:
    exist = True
    break
    
if exist:
  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'
print(ans)

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"
print(ans)

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(X+1):
  leg = i * 2 + (X - i) * 4
  if Y==leg:
    print('Yes')
    break
  else:
    continue
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())

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

if a.is_integer() and b.is_integer() and a>=0 and b>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
ans = 0
flag = False
for turu in range(X+1):
    for kame in range(X+1):
        if kame*4 + turu*2 == Y and turu+kame == X:
            print("Yes")
            flag = True
            break
        elif turu+kame == 2*X:
            print("No")
            flag = True
            break
    if flag:
        break

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ans = False
for i in range(x + 1):
    sum = 2 * (x - i) + 4 * i
    if sum == y:
        ans = True
    elif sum > y:
        break

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

Submission status: Accepted

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

for i in range(0, X+1):
  if 4*i + 2*(X-i) == Y:
    flg = True
    break
  else:
    flg = False
if flg == True:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n,l = map(int,input().split())
count = 0 

for i in range(n+1):
  if 4*i+2*(n-i)-l == 0:
    print("Yes")
    count = 1
    break

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

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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

ans = False

for c in range(x+1):
    t = x - c 
    LEG = 2*c + 4*t

    if LEG == y:
        ans = True
        break

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# atcoder 
# Türkler var mı?
# Herkese memnün oldum
import sys
import math

iimr = lambda: map(int, sys.stdin.readline().rstrip().split())
readline = sys.stdin.readline
sys.setrecursionlimit(10 ** 8)

kame = 4
tsuru = 2

def 関数(x, y):
    if (x * 4) < y or (x * 2) > y:
        return "No"
    else:
        # C'est possible de diviser le y
        for a in range(x+1):
            for b in range(x+1):
                ax = a * 4
                bx = b * 2
                #print(ax,bx)
                if (bx + ax) == y and (a + b) == x:
                    #res = bx + ax
                    #print(ax, bx, "res=:{0}".format(res))
                    return("Yes")

    return("No")
                    

def çözmek():
    X,Y = map(int, sys.stdin.readline().split())

    res = []
    res.append(関数(X,Y))
    print(*res, sep="\n")

if __name__ == "__main__":
    çözmek()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

all_kame = y - 2*x
#print(type(all_kame))
if all_kame < 0:
    print("No")
    
elif all_kame == 0:
    print("Yes")
    
else:
    for i in range(x+1):
        if all_kame - 2*(x-i) ==0:
            print("Yes")
            exit()
    print("No")

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
p = []
ans = 0

for i in range(x):
    p.append(4)

for a in range(x):
    if sum(p)==y:
        ans = 1
        break
    else:
        p.remove(4)
        p.append(2)
if ans == 0:
    if sum(p)==y:
        ans = 1

if ans == 1:
    print('Yes')
else:
    if (y==2)&(x==1):
        print('Yes')
    if (y==4)&(x==1):
        print('Yes')
    else :
        print('No')

Submission status: Accepted

Solution code:
X, Y = [int(num) for num in input().split()]
b = (Y - 2*X) / 2
if 2*X > Y or Y > 4*X:
  print("No")
else:
  if int(b) == b:
  	print("Yes")
  else:
  	print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ans = 'No'
if y in range(x*2, (x*4)+1):
    if y%2==0:
        ans='Yes'

print(ans)

Submission status: Accepted

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

#yをxこの2,4の組み合わせで記述できるか
#yを4で割った余りが0か2で
#あまり無し商<=x あまりあり商＋１<=x
#y=100の時には少なくとも25匹いればよい
#y=102の時は？　少なくとも100//4+1匹＝ceil((102/2)/2)匹
#逆にy=100の時xの上限は　50

if y%2==0 and math.ceil((y/2)/2)<=x and x<=(y/2):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

X = a[0]
Y = a[1]
 
if (Y-2*X) % 2 == 0 and (Y-2*X) >= 0 and (4*X-Y) % 2 == 0 and (4*X-Y) >= 0:
	print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    X, Y = MI()

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

tmp_legs = x * 4
diff = tmp_legs - y

if diff < 0:
    print("No")
    exit()
elif diff == 0:
    print("Yes")
    exit(0)

head_crane = diff//2

if diff/2 - head_crane != 0:
    print("No")
    exit()
elif head_crane > x:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    X, Y = map(int, input().split())
    tmp = X * 4 - Y
    if tmp%2 != 0:
        print("No")
        return
    turu = tmp // 2
    kame = X - turu
    if turu >= 0 and kame >= 0:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x, y = input().split()
x = int(x)
y = int(y)
for k in range(min(x, (y + 1) // 4),-1,-1):
    r = 4 * k
    t = (y - r) // 2
    r += t * 2
    if k + t == x and r == y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

for i in range(51):
  for j in range(26):
    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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
tsuru = 0
kame = X
ashi = 0
flag = False
for i in range(X+1):
    ashi = tsuru * 2 + kame * 4
    if(Y == ashi):
        flag = True
        break
    tsuru+=1
    kame-=1

if(flag):
    print("Yes")
else:
    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:
# 170 B

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

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

print(res)

Submission status: Accepted

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

flag = 0

for i in range(xy[0] + 1):
  total = i * 2 + (xy[0] - i) * 4
  if total == xy[1]:
    flag = 1
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=(map(int,input().split()))
C,T=2*X-Y/2,Y/2-X
x1,x2=C.is_integer(),T.is_integer()
if x1==x2==True and C>=0 and T>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
X, Y = map(int,input().split())
for i in range(0,100):
    for j in range(0,100):
        if i + j > 100:
            break
        if i+j == X:
            if 2*i+4*j == Y:
                print("Yes")
                sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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