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 = [int(i)  for i in input().split()]

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    X, Y = [int(item) for item in input().split()]

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

    if y > 4 * x:
        print('No')
        sys.exit()

    if y < 2 * x:
        print('No')
        sys.exit()

    if not (y % 2 == 0):
        print('No')
        sys.exit()
    
    if (y - 2 * x) % 2 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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 and 2 * i + 4 * j == Y:
            print("Yes")
            exit()

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 2*i + 4*j == y and i + j == x:
            ans = 'Yes'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if x[1]%2 == 1:
    print('No')
elif x[0]*2 <= x[1] <= x[0]*4:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# すべて鶴だと仮定する
turu = X

asi = turu * 2

if asi > Y or (Y % 2) != 0 or X * 4 < Y:
    print("No")
else:
    husoku = Y - asi

    kame = husoku // 2

    turu = turu - kame

    if turu * 2 + kame * 4 == Y:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

if X * 4 < Y:
    print("No")
elif Y % 2 != 0:
    print("No")
else:
    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 = (int(x) for x in input().split())

ans = ''

tsuru = (4 * x - y) / 2
kame = x - tsuru

if tsuru >= 0 and kame >= 0 and tsuru % 1 == 0 and kame % 1 == 0 :
    ans = 'Yes'
else :
    ans = 'No'

# print(tsuru)
# print(kame)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = 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())
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())

if 2 * x > y 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())

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

else:
    print('No')

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
p = (4*X-Y)/2
q = (Y-2*X)/2
result = 'No'
if (4*X-Y)%2==0 and (Y-2*X)%2==0:
	if p>=0 and q>=0:
		if not(p==0 and q==0):
			result ='Yes'
print(result)

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

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

Submission status: Accepted

Solution code:
def main():
    X , Y = map(float, input().split())
    a = 2.0 * X - Y / 2.0
    b = Y / 2.0 - X
    c = a % 1
    d = b % 1
    #print(c.is_integer())
    #print(d.is_integer())
    if c.is_integer() == True and d.is_integer() == True and a > 0 and b > 0 :
        print("Yes")
    elif c.is_integer() == True and d.is_integer() == True and a == 0 and b > 0 :
        print("Yes")
    elif c.is_integer() == True and d.is_integer() == True and a > 0 and b == 0 :
        print("Yes")
    else :
        print("No")



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    #n = int(input())
    #x = list(map( int, input().split()))
    x,y = map( int, input().split())
    turuka = (4*x-y)/2
    if turuka > x:
        print("No")
    elif turuka % 1 == 0 and turuka >= 0:
        print("Yes")
    else:
        print("No") 
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
in_str = list(map(int,input().split()))
x = in_str[0]
y = in_str[1]

def check():
    for i in range(0, x + 1):
        if (y - (2 * i)) / 4 == x - i:
            return 'Yes'
    return 'No'

print(check())

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

if 0<=(4*X-Y)//2<=X and (4*X-Y)%2==0:
    print('Yes')
    exit(0)

print('No')

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
if((Y%4==0 or 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())

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

print(ans)

Submission status: Accepted

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

    all_crane = x * 2
    all_turtle = x * 4

    if y >= all_crane and y <= all_turtle and y % 2 == 0:
        print("Yes")
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X, Y = (int(x) for x in input().split())
B = Y - 2 * X
A = B/2 #A : カメ(4本足)の匹数

if A < 0 or B % 2 == 1 or X < A:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

ans = "No"
for crane in range(x+1):
    if crane*2 + (x - crane)*4 == y:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if (y-2*x)%2!=0:
  print("No")
else:
  k = (y-2*x)//2
  t = x-k

  if 0 <= k and 0 <= t:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
animals, foots = map(int, input().split())

syo, jyoyo = divmod(foots, 2)

if jyoyo == 0 and animals <= syo <= animals * 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


ans=False

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max_leg = x * 4
min_exists = y / 2

if y > max_leg or y % 2 != 0 or x > min_exists:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import math

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

turtles = (y-2*x)/2
cranes = (4*x-y)/2
if turtles == math.ceil(turtles) and turtles >= 0 and cranes == math.ceil(cranes) and cranes >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

result = False
hiki = x


for kame in range(x+1):
    turu = hiki - kame
    if turu * 2 + kame * 4 == y:
        result = True


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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ans = "No"
for i in range(0, x+1):
    for j in range(0, x+1):

        if i + j > x:
            break

        if i + j != x:
            continue

        if i * 2 + j * 4 == y:
            ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k=0

for a in range(100):
  for b in range(100):
    if a+b==X and 2*a+4*b==Y:
      print('Yes')
      k=1
      break
      
if k==0:
  print('No')

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement
animal_count, leg_count = map(int, input().split(' '))

# 0番地が鶴、1番地を亀とする
animals = [2, 4]

#print(animal_count, leg_count)

found = False
for case in combinations_with_replacement(animals, animal_count):
  #print(case)
  if(sum(case) == leg_count):
    found = True
    break

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

Submission status: Accepted

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

ans = 'No'

for a in range(1, x+1):
    b = x - a
    if b == x:
        break
    if 2*a + 4*b == y or 2*b + 4*a == y:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x, y = [int(x) for x in input().split()]
    z = (4 * x - y) / 2

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


main()

Submission status: Accepted

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

y = ( Y - 2 * X) / 2
x = X - y

if y.is_integer() and x.is_integer() and y > -1 and x > -1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x, y = map(int, input().split())
animal = [0, 0]
animal[1] = (y - 2*x)/2
animal[0] = x - animal[1]

result = True
if (y - 2*x) % 2 != 0 or animal[1] < 0:
    print('No')
elif animal[0] < 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
a=0
c=y
while a<30:
    if c==2*(x-a) and c>=0:
        print("Yes")
        break
    c=c-4
    a+=1

if a==30:
    print('No')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC170b

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

ans = 0

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for a in range(X+1):
    b = X - a
    if 2*a + 4*b == Y:
        print("Yes")
        exit(0)
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:
pre = input().split()
X = int(pre[0])
Y = int(pre[1])

#2t+4k=Y
#t=X-k
#k=X-t

#2X-2k+4k =Y
#2k = Y-2X
#k = Y/2 - X
#X-t = Y/2 -X
#t = 2X -Y/2

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

Submission status: Accepted

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

crane = (4 * x - y) // 2
turtle = x - crane
if y % 2 == 0 and crane >= 0 and turtle >= 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")
    exit()

print("No")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    b, c = map(int, input().split())
    flag = False
    for i in range(b+1):
        count = i*2 + (b-i)*4
        if count ==c:
            flag=True
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
X,Y=[int(x) for x in input().rstrip().split()]
y=float((Y-2*X)/2)
x=float(X-y)

if x.is_integer() and y.is_integer():
  if x==0 and y==0:
    print("No")
    sys.exit()

  if 0<=x and 0<=y:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def int1(x): return int(x) - 1
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def mi1(): return map(int1, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def lli(rows_number): return [li() for _ in range(rows_number)]


if __name__ == "__main__":
    x, y = mi()
    tks = []
    for i in range(x+1):
        tks.append([i, x-i])
    for tk in tks:
        if tk[0]*2 + tk[1]*4 == y:
            print('Yes')
            exit()
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement

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

choise_list = []

for A in combinations_with_replacement(range(1, 3), x):
    choise_list.append(A)
    
flag = False
    

for choise in choise_list:
    ans = choise.count(1) * 2 + choise.count(2) * 4
    if ans == y:
        print("Yes")
        flag = True
        break

if not flag:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

x, y = map(int, input().split()) # x:頭数 y:足
for i in range(x + 1):
    if i * 4 + (x - i) * 2 == y:
        print('Yes')
        sys.exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (x, y) = [int(e) for e in lines[0].split(' ')]

    return (x, y)


def solve(x, y):
    
    result = 'No'
    for c in range(0, 101):
        for t in range(0, 101):
            if c + t == x and 2 * c + 4 * t == y:
                result = 'Yes'
                break
                


    return result    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
import sys

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

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

main()

Submission status: Accepted

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

if K_2 >= 0 and K_2 % 2 == 0 and x - (K_2 // 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 and X-i >= 0:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

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

flag = False
for i in range(x+1):
  v = i
  t = x - i
  f = 2 * v + 4 * t
  if f == y:
    flag = True

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

Submission status: Accepted

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

asi = y - x * 2
if asi % 2 == 0:
    kame = asi / 2
else:
    print("No")
    exit()
turu = x - kame

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

Submission status: Accepted

Solution code:
a=[int(x) for x in input().split()]
b = (a[1]-(2*a[0])) / 2
c = (a[1]-(4*a[0])) / -2
if b >= 0 and c >= 0 and b.is_integer() and c.is_integer:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
a = 2 * x - y / 2
b = -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 a in range(0, X+1):
    b = X - a
    if Y == 2*a + 4*b:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

if X != 1:
    for turu in range(0, X + 1, 1):
        kame = X - turu
        legs = kame * 4 + turu * 2
        if legs == Y:
            print("Yes")
            break
    else:
        print("No")
else:
    if Y % 2 == 0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
flag=False
for i in range(x+1):
  yi=2*i+4*(x-i)
  if y==yi:
    flag=True
    break
    
print("Yes") if flag else 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<0 or d<0:
    print("No")
else:
    if c.is_integer() == True and d.is_integer() == True:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
x, y = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
#ab = [list(map(int, input().split())) for i in range(n)]
# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))

# xひき　y本
total = 0
for i in range(0, x+1):
    total = 2*i + 4*(x-i)
    
    if total == y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
tx=x
flag=False
i=y
while(i>=0):
    if (i%2) ==0 and (i//2)==x:
        flag=True
        break
    x-=1
    i-=4
    if(x<0):
        break
if(flag):
    print("Yes")
else:
    if (y%4)==0 and (y//4)==tx:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *
from sys import stdin,stdout
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
import math
import math
import time
from queue import Queue
# PradeepGhosh_2017076

def seive(n):
	l=[True]
	l=l*(n+1)
	for i in range(2,int(sqrt(n))+1):
		if(l[i]==True):
			val=i*i
			while(val<len(l)):
				l[val]=False
				val+=i
	prime=[]
	for i in range(2,len(l)):
		if(l[i]==True):
			prime.append(i)
	return prime

def dp(l,i,n,val,ans):
	if(i>=n or val<0):
		return 1000000
	elif(val==0):
		return 0
	else:
		if(ans[i]==1000000):
			ans[i]=min(min(1+dp(l,i+1,n,val-l[i],ans),1+dp(l,i,n,val-l[i],ans)),dp(l,i+1,n,val,ans))
		return ans[i]
from queue import Queue
def factors(n):
	l=[]
	for i in range(1,int(sqrt(n))+1):
		if(n%i==0):
			if(n//i==i):
				l.append(i)
			else:
				l.append(i)
				l.append(n//i)
	return l
if __name__ == '__main__':
	x,y=map(int,input().split(" "))
	ans=-1
	for i in range(x+1):
		for j in range(x+1):
			if(i*4+j*2==y and i+j==x):
				ans=1
				break
		if(ans==1):
			break
	if(ans==1):
		print("Yes")
	else:
		print("No")

Submission status: Accepted

Solution code:
def crane_and_title(animals: int, foot: int) -> bool:
    if foot % 2:
        return False
    if foot < 2 * animals or 4 * animals < foot:
        return False
    return True


if __name__ == "__main__":
    X, Y = map(int, input().split())
    yes = crane_and_title(X, Y)
    print("Yes" if yes else "No")

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if y%2!=0:
    print("No")
    exit()

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

def tami(turu, kame):
  if turu*2 + kame*4 == y:
    #print(turu,kame)
    return True
  else:
    return False

x,y =IL()

for turu in range(x+1):
  kame = x - turu
  if tami(turu, kame):
    print("Yes")
    exit()
else:
  print("No")

Submission status: Accepted

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

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

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

if a < 0 or b < 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
# B
X, Y = map(int, input().split())
A = ((4 * X) - Y) // 2
B = (Y - 2*X) // 2
if (A >= 0 and B >= 0 and A + B == X):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement
X, Y = map(int, input().split())
if Y % 2 != 0:
    print('No')
    exit()

for i in list(combinations_with_replacement([2,4], X)):
    if sum(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 2 * i + 4 * (X - i) == Y:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

Solution code:
import sys

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

if X > 50:
    print("No")
    sys.exit()

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

    if i * 4 + (X - i) * 2 == Y:
        print("Yes")
        sys.exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for a in range(0, 51):
    for b in range(0, 51):
        if (a+b) == x and (2*a+4*b)==y:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

#足が奇数
if Y%2 ==1:
  print("No")
#全部鶴
elif 2*X > Y:
  print("No")
#全部カメ
elif 4*X <Y:
  print("No")
  
#解が存在する
else:
  print("Yes")

Submission status: Accepted

Solution code:
import sys

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

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

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

    if (a + b != X) or (2*a + 4*b != Y):
        print('No')
    elif a < 0 or b < 0:
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = "No"

if a >= 0 and b >= 0 and y%2 == 0:
    ans = "Yes"
    
print(ans)

Submission status: Accepted

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

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

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

flg = True

if b < 0:
  flg = False

if (2 * b) % 2 == 1 :
  flg = False

a = 2*x -2*b
if a < 0:
  flg = False

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

Submission status: Accepted

Solution code:
x, y = map(lambda x: int(x), 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())

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

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