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())
Y -= 2 * X
if Y < 0 or Y % 2 == 1:
    print('No')
    exit()
Y /= 2
if Y <= X:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a = input()
[x, y] = [int(comp) for comp in a.split()]
flag = 0
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 (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:
x, y = input().split()
# x number of animal
# y number of legs
x, y = int(x),int(y)
for a in range(100):
    for b in range(100):
        if (a * 2) + (b * 4) == y and a + b == x:
            print("Yes")
            exit(0)
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

y = int(y/2)

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

Submission status: Accepted

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

Submission status: Accepted

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

if y % 2 != 0:
    print("No")
else:
    a = 2 * x - 1/2 * y
    b = y * 1/2  - x

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
result='No'
for i in range(0,101):
    for d in range(0,101):
        if i+d==x:
            if i*2+d*4==y or i*4+d*2==y:
                result='Yes'
                break
print(result)

Submission status: Accepted

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

i = 0
while i <= X:
    j = X - i
    K = (2 * i) + (4 * j)
    if K == Y:
        print('Yes')
        exit()
    i += 1

print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
correct = False
if(y % 2 == 0):
  for legs in range(2*x, 4*x + 1, 2):
    if(legs == y):
      correct = True
      break
print("Yes" if correct else "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())

a = (4*X - Y) / 2
b = (Y - 2*X) / 2
res = "Yes"

if a < 0 or b < 0:
    res = "No"

if a.is_integer() and b.is_integer():
    pass
else:
    res = "No"

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    X,Y=pin()
    cond=0
    for i in range(X+1):
        if 4*i+2*(X-i)==Y:
            cond=1
    print(["No","Yes"][cond])
#%%submit!
resolve()

Submission status: Accepted

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

a = 4 * X - Y
b = Y - 2 * X

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

Submission status: Accepted

Solution code:

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

for i in range(0,101):
    for j in range(0,101):
        if i*2 + j*4 == y:
            if 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):
    # i += 1
    if 2 * i + 4 * (X - i) == Y:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

t = a[1]/2 - a[0]
c = 2 * a[0] - a[1] / 2

if (t % 1 == 0 and c % 1 == 0 and t >= 0 and c >= 0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

a = 0
b = x - a
ans = False

while a <= x:
    if (4 * a + 2 *b) == y:
        ans = True
        break
    a += 1
    b -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

if (y < 2*x) or (4*x < y) :
    print('No')
elif (y%2 == 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
    foot = 2 * crane + 4 * turtle
    if foot == y:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if Y > (4*X):
    print('No')

elif Y < (2*X):
    print('No')

elif Y % 2 != 0:
    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())
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())
ans="No"
for crane in range(100):
  for turtle in range(100):
    if crane+turtle == X and 2*crane+4*turtle == Y:
      ans="Yes"
      break
print(ans)

Submission status: Accepted

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

found = False
# if (X == 1) :
#     if (Y == 2 or Y == 4) :
#         found = True

for i in range(X+1) :
    kame_legs = 4 * i
    tsuru_legs = 2 * (X-i)
    if (Y == kame_legs + tsuru_legs) :
        # print("tsuru", tsuru_legs, "kame", kame_legs)
        found = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

# どちらか一方のみいる場合
if X * 2 == Y or X * 4 == Y:
  print('Yes')
  exit()
  
# 両方いる場合
for i in range(1,X+1):
  tmp = 2 * i + 4 * (X - i)
  if tmp == Y:
    print('Yes')
    exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if b%2==1:
    print("No")

if b%2==0:
    if 2*a <= b <= 4*a:
        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 and (-2*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 i * 2 + (X - i) * 4 == Y:
        print("Yes")
        exit()
print("No")

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

print('No')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().split(" ")
h = int(a[0])
l = int(a[1])
if l % 2 == 1:
    print("No")
elif l / 2 < h:
    print("No")
elif l / 4 > h:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if Y%2 == 1:
    print("No")
else:
    Tsuru = 2*X -Y/2
    Kame  = -X + Y/2
    if Tsuru < 0 or Kame < 0:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
def main():
    import sys
    X, Y = map(int, sys.stdin.readline().split())
    #Y = T*2 + K*4
    #X = T+K
    a = (4*X -Y)/2
    b = (-2*X+Y)/2
    if int(a)==a and int(b)==b:
        if a>=0 and b>=0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')







if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for cnt_tsuru in range(x+1):
    cnt_kame = x - cnt_tsuru
    if y == 2 * cnt_tsuru + 4 * cnt_kame:
        count += 1
if count != 0:
    print('Yes')
else:
    print('No')

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=map(int,input().split())
miss=False
if (y-2*x)%2==1:
  miss=True
else:
  b=(y-2*x)//2
  if not 0<= b<=x:
    miss=True
if miss:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
'''     ##     ##  #######  # #  ######
        ##     ##  ##   ##  ###    ##
        ##     ##  ##    #  # #    ##
        #########  #######  # #    ##    '''

import sys
import math
# sys.setrecursionlimit(10**6)

def get_ints(): return map(int, input().strip().split())
def get_list(): return list(get_ints())

def printspx(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")
def printchk(*args): return print(*args, end=" \ ")

MODPRIME = int(1e9+7); BABYMODPR = 998244353;

ONLINE_JUDGE = 1
if not ONLINE_JUDGE:
    sys.stdin = open("input.txt","r")  # <<<  Comment this line  >>> #
    sys.stdout = open("output.txt","w")  # <<<  Comment this line  >>> #
    sys.stderr = open("output.txt","w")  # <<<  Comment this line  >>> #

# for _testcases_ in range(int(input())):
x, y = get_ints()
flag = True
b = (y-2*x)/2
if math.floor(b) != b or b < 0:
    flag = False
if flag:
    a = x-b
    if a < 0 :
        flag = False
if flag:
    print("Yes")
else:
    print("No")

'''
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
THE LOGIC AND APPROACH IS BY ME @luctivud ( UDIT GUPTA )
SOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE::
(I Own the code if no link is provided here or I may have missed mentioning it)
DO NOT PLAGIARISE.
TESTCASES:
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
'''

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    x, y = map(int, input().split())
    for i in range(x+1):
        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())
c=[]
for i in range(x+1):
  c.append([i,x-i])
for i,j in c:
  if i*2+j*4==y:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
from sys import exit
X,Y = map(int,input().split())

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

print("No")

Submission status: Accepted

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

answer = 'No'

for i in range(0, animal+1):
    temp = 2 * i + 4 * (animal-i)
    if temp == leg:
        answer = 'Yes'
        break

print(answer)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    X, Y = map(int, input().split())
    ans = "No"
    for i in range(101):
        for j in range(101):
            if i + j == X and 2 * i + 4 * j == Y:
                ans = "Yes"
                break
    print(ans)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

min=2*x
max=4*x
flag=0

for tmp in range(min,max+1,2):
    if tmp == y:
        flag=1

if flag == 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')
else:
    print('No')

Submission status: Accepted

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

res = "No"
x = (4*X-Y)
y = (Y-2*X)

if x>=0 and y>=0 and x%2==0 and y%2==0:
    res = "Yes"

print(res)

Submission status: Accepted

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

s=2*x-y/2
t=int(s)

ans="No"

if s >= 0 :
  if s==t :
    if s <= x:
      ans="Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

tsuru = x
kame = 0

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

print('No')

Submission status: Accepted

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

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

    if X*4 == Y:
        return 'Yes'

    return 'No'

print(main())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
if a[1]%2 == 1:
  print('No')
else:
  if a[0]*2<= a[1] and a[1] <= a[0]*4:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
x, y = M()
ans = 'No'
for i in range(x+1):
    for j in range(x+1):
        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())
if 2*x <= y <= 4*x and y%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

X=arr[0]
Y=arr[1]


if Y%2==1:
	print('No')
	exit()

Y2=Y/2
if Y2<X :
	print('No')
	exit()
if X*2<Y2 :
	print('No')
	exit()

print('Yes')

Submission status: Accepted

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

print('No')

Submission status: Accepted

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

if float.is_integer(-x + y/2) and float.is_integer(2 * x - y/2) and (0 <= 2 * x - y/2) and (0 <= -x + y/2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if crane < 0 or turtle < 0:
    print('No')
elif crane.is_integer() and turtle.is_integer():
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    x, y = i_map()

    for i in range(x+1):
        turu = i
        kame = x - turu
        # print(turu,kame)
        if (turu * 2 + kame * 4) == y:
            print('Yes')
            exit() 

    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
flag = 0
lst = input().split()
lst[0]=int(lst[0])
lst[1]=int(lst[1])
if lst[1]%2 == 1 :
    flag =1
if lst[0] < lst[1]/4 :
    flag = 1
if lst[0] > lst[1]/2 :
    flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = (int(i) for i in 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 = [int(x) for x in input().split()]
c, t = x, 0
flag = False
for i in range(x+1):
    if 2*c + 4*t == y:
        print("Yes")
        flag = True
    c -= 1
    t += 1
if not flag:
    print("No")

Submission status: Accepted

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

kame = (Y-X*2)//2
#print(kame)

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

Submission status: Accepted

Solution code:
import math
import sys
x, y = map(int, input().split())
a = (4 * x - y) / 2
if y % 2:
    print('No')
    sys.exit()
if a >= 0 and a <= x:
    if math.floor(a) == int(a):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

X, Y = MAP()

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

if a >= 0 and b >= 0 and a%1 == 0 and b%1 == 0:
    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 = 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())

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

j = y/2 - x
i = 2*x - y/2

if (j == abs(int(j))) and (i == abs(int(i))):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def _main(x, y):
    b = (y - 2 * x) // 2
    a = x - b

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


_main(*map(int, input().split()))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
flag = 1
if Y %2 ==1:
    flag=0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__=="__main__":
    # Problem B
    X, Y = map(int, input().split(' '))
    ans = "No"
    for i in range(X):
        if i*2 + (X-i)*4 == Y or i*4 + (X-i)*2 == Y:
            ans = "Yes"
            break
    print(ans)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    X, Y = LI()

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

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

tmp = 4 * x - y
f = 0
if tmp % 2 == 0 and tmp >= 0:
    crane = tmp / 2
    turtle = x - crane
    if turtle >= 0:
        f = 1
    else:
        pass
else:
    pass

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())#X匹、Y本の足
a = 0#つる
b = X - a#かめ
for i in range(X+1):
  a = i
  b = X - a
  if a * 2 + b * 4 == Y:
    print("Yes")
    break
  elif b == 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)==0:
    print("Yes")
    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:
#B
x,y=map(int,input().split())
a=0
if (4*x-y)%2==0 and (4*x-y)>=0 and (-2*x+y)>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
	X, Y = map(int, input().split(" "))
	for a in range(X+1):
		if (2*a + 4*(X-a)) == Y:
			print("Yes")
			return
	print("No")
    
      
if __name__ == "__main__":
  main()

Submission status: Accepted

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

xx = X * 2

if Y % 2 != 0:
    print("No")
elif xx > Y:
    print("No")
elif (Y - xx) / 2 > X:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

Boo = False

tsuru = 0
kame = 0

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

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