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: Wrong Answer

Solution code:
number = input()
list = number.split()


def hoge(a, b):
    if b % 3 == 0 or a * 4 < b:
        print("No")
        return
    else:
        for i in range(a):
            n = i + 1
            n2 = a - n
            if n * 2 + n2 * 4 == b:
                print("Yes")
                return
        else:
            if a * 4 == b:
                print("Yes")
                return
            print("No")


hoge(int(list[0]), int(list[1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

x, y = map(int, input().split())
x *= 2
y -= x
if(y == 0):
  print('Yes')
  sys.exit()

for i in range(x):
  y -= 2
  if(y == 0):
    print('Yes')
    sys.exit()

print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,l=map(int,input().split())
temp=l//2
temp2=abs(temp-h)
temp1=abs(h-temp2)
if ((temp2*4)+(temp1*2))==l:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y= map(int, input().split())
if y %2 == 0:
    if x*4 >=  y >= x*2:
      for i in range(x):
        if (x*4) - ((x-i)*2) == y:
            print("YES")
            break
      else:
        print("NO")
    else:
        print("NO")
else:
      print("NO")

Submission status: Wrong Answer

Solution code:
import numpy as np
X,Y=map(int, input().split())
A = np.matrix([
[1, 1],
[2, 4]
])
Y = np.matrix([
[X],
[Y]
])

try:
    ANS=(np.linalg.inv(A)*Y).tolist()
    if min(np.linalg.inv(A)*Y)>=0:
        if ANS[0][0].is_integer() and ANS[1][0].is_integer():
            ANS="Yes"
    else:
        ANS="No"
except:
    ANS="No"

print(ANS)

Submission status: Wrong Answer

Solution code:
import numpy as np
X, Y=map(int,input().split())

crit=(4*X-Y)/2

ans="No"
if crit>=0 and int(crit)==crit:
  ans="Yes"

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

turu_all = 2 * x
kame = (y - turu_all) / 2

turu = x - kame
if x == turu + kame:
    ans = "Yes"
    if kame > x:
        ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
ans = False
for i in range(a[0]):
  if ((a[1] - i * 4 ) //2 +i == a[0]) or (i+1 == a[0]):
    ans = True
    break
if ans:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout
import math
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=1000000007
ani,total = iia()
if 2<=(4*ani-total)<=2*ani-2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def resolve():
	# N: number of Tsuru
	# Y = 2N + 4(X-N) = 4X -2N
	# print 'Yes' if int N exists for given equation or 'No'.
	# X: total animals, Y: total legs
	X, Y = map(int, input().split())
	K = (4 * X) - Y
	if Y % 2 != 0: # Y shuldn't odd.
		print('No')
	elif Y < 6: # 2*1 + 4*1 = 6
		print('No')
	elif 0 < K < 50:
		print('Yes')
	else:
		print('No')
resolve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

if X == 1:
    if (Y == 2) or (Y == 4):
        flag = True
        
for i in range(X):
    for j in range(X):
        if i + j != X:
            continue
        if 2*i+4*j == Y:
            flag = True
            break


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1):
    print('No')
    return
  if nl / (nb * 4) > nb:
    print('No')
    return
  if (nl % (nb * 2)) % 2 == 0:
    print('Yes')
  else:
    print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().split()
intX = int(s[0])
intY = int(s[1])
if (intX >= intY / 2) :
    print('No')
    exit()

if ((intY / intX) > 4) :
    print('No')
    exit()

q, mod = divmod(intY, 2)
if (mod == 1) : 
    print('No')
    exit()

intB = (intY-2*intX) / 4
q2, mod2 = divmod(intB, 1)
if (mod == 0) : 
    print('Yes')
    exit()
print('No')

Submission status: Wrong Answer

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

#2z + 4(X-z) = Y
#-2z = Y - 4X
z = 2*X - 0.5*Y

if(0 < z and z.is_integer):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mm = l*4

a = (mm - m) % 2
b = (mm - m) // 2

if mm // 4 == l and mm == m:
  print("Yes")
elif a == 0 and abs(b) + (l-b) == l:
    print("i")
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
crain = (4 * N - M) / 2
if crain.is_integer() and crain > 0:
    crain = int(crain)
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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


crain = (4 * x - y) / 2
turtle = (y - 2*x) /2 
if crain.is_integer() and crain > 0:
    crain = int(crain)
    print('Yes')
elif crain == 0 or turtle == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

if x * 4 >= y:
    print('Yes')
    exit()
    
print('No')

Submission status: Wrong Answer

Solution code:
import sys 
X,Y = map(int, input().split())
for i in range(X+1):
    for j in range(X+1):
        if (((2*i) + (3*j)) == Y) or (((2*j) + (3*i)) == Y):
            if (i+j == X) or (i + j < X):
                print("Yes")
                sys.exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(X+1):
    for j in range(X+1):
        S = Y - 2*i - 4*j
        if S == 0:
            ans = 1
            break
        else:
            pass

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

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(1)] 
li = list(map(float, s[0].split()))
li1 = li[0]
li2 = li[1]
y = ((li2 /2 - li1) * 10)%10
if y == 0:
    if li1 - (li2 /2 - li1) >= 0:
        print("Yes")
    if li1 - (li2/2 - li1) < 0:
        print("No")
if y != 0:
    print("No")

Submission status: Wrong Answer

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

for i in range(x):
    
    if y>=4:
        y=y-4
        
    elif y>=2:
        y=y-2
    

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

else:
    N_max = int(Y/2)
    for n in list(range(N_max, -1, -2)):
        if X == n + (N_max - n)/2:
            print("Yes")
            break
        else:
            if n == 0:
                print("No")

Submission status: Wrong Answer

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

k = n*4

r = k-m

if(r == 0):
    print("Yes")
else:
    if(r >= 0):
        if(r%2 == 0):
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=a*4
if(b%2==1):
    print("NO")
else:
    if((c-b)/2<=100):
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

if X == 1:
    if (Y == 2) or (Y == 4):
        flag = True
        
for i in range(X):
    for j in range(X):
        if i + j != X:
            continue
        print(i,j)
        print(2*i+4*j)
        if 2*i+4*j == Y:
            flag = True
            break


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if y % 2 != 0:
    print("NO")
elif y % 2 == 0:
    s  = "A"
    for i in range(0,101):
        for j in range(0,101):
            if 2*i + 4*j == y and i + j == x:
                print("YES")
                exit()
            else:
                s = "NO"
    print(s)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
x, y = map(int, input().split())

if x == 1:
    if (y == 2) or (y == 4):
        print("Yes")
    else:
        print("No")
else:
    ans = (4 * x - y) / 2

    if ans == 0:
        print("Yes")
    if not (ans.is_integer):
        print("No")   
    if ans <= x and ans >= 1:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

for t in range(X + 1):
    for c in range(X + 1):
        if X < t + c:
            break
        
        if Y == ((t * 4) + (c * 2)):
            print("Yes")
            sys.exit()

print("No")

Submission status: Wrong Answer

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

no_flag = 0

if y - (4 * x) == 0:
    print("Yes")
elif y - (2 * x) == 0:
    print("Yes")
else:
    for cnt in range(x):
        if y >= 4 and y - (2*(x-(cnt))) != 0:
            y -= 4
        elif y >= 2:
            y -= 2

        if y == 0 and cnt == x-1:
            no_flag = 0
        else:
            no_flag = 1

    if no_flag == 0:
        print("Yes")
    elif no_flag == 1:
        print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout
import math
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=1000000007
ani,total = iia()
if 0<=(4*ani-total)<=2*ani:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
XY = list(map(int, input().split()))
 
c = 2 * XY[0] - XY[1] / 2
t = - XY[0] + XY[1] / 2
 
if not isinstance(XY[1] / 2, int):
  print('No')
elif c == 0 and t == 0:
  print('No')
elif c >= 0 and t >= 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
crain = (4 * N - M) / 2
if crain.is_integer() and crain >= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n=input()
x,y=n.split()
c=(4*int(x)-int(y))/2
t=int(x)-c
if c.is_integer and t.is_integer and 100>=c>=0 and 100>=t>=0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

XY = list(map(int,input().split()))

X = XY[0]
Y = XY[1]

A = np.array([
    [1,1],
    [2,4]
])

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

x = np.linalg.solve(A,b)

if x[0] >= 0 and x[1] >= 0:
    if not(x[0] == 0 and x[1] == 0):
        print('Yes')

    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import itertools
x, y = map(int, input().split())
num = [i for i in range(x + 1)]
comb = list(itertools.combinations(num, 2))
for j in comb:
    if j[0] * 4 + j[1] * 2 == y:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for k in range(50):
    kame = k
    turu = x-k
    ashi = 2*turu + 4*kame
    if ashi==y:
        count += 1
        break

if count>0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#-*- using:utf-8 -*-
 
X, Y = map(int, input().split())
a = (4*X-Y)/2
b = (2*X-Y)/2
if(X*2 <= Y and Y <= X*4):
    if a.is_integer() and b.is_integer():
        if a > 0 or b > 0:
            print("YES")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
[S,Y] = [int(i) for i in input().split()]
S += 1
f = True

if Y % 2 == 1:
  print("No")
else:
  for x in range(S):
    for y in range(S-x):
      if 4*x + 2*y == Y:
        print("Yes")
        f = False
        break

if f:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if x-kame<0 or kame<0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a=input()
a=[int(i) for i in a.split()]

if a[1]%2==1 or a[1]==0:
	print("No")

else:
	if 4*a[0]<a[1]:
		print("No")

	else:
		print("Yes")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
def func(x):
    for i in range(0,1,x[0]+1):
        for j in range(0,1,x[0]+1):
            if i+j>x[0]:
                break
            if i*2 + j*4 == x[1]:
                print('Yes')
                return
    print('No')
    return
func(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#turu = t
#kame = x - t
turu = 0
kame = 0
flag = 0
for t in range(1,x + 1):
    if t * 2 + (x - t) * 4 == y:
        turu = t
        kame = x - t
        flag = 1
        break
    else:
        pass

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
if b>=a and b<=2*a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# Xは動物の総数,Yは動物の足の総数
X,Y = map(int, input().split())

# 亀は4本の足を持ち，鶴は2本の足を持つ．
kame = 4
turu = 2

# まずは鶴が1匹の時だけを判定,奇数は有えないので排除
if Y == 2 and X == 1:
  print("Yes")
elif Y == 100 and X*kame < Y:
  print("No")
elif Y % turu != 0:
  print("No")
else:
  ans = Y
  while True:
    Y = Y % 2
    ans = ans/2
    if Y != 0:
      print("No")
      break
    elif Y == 0 and ans == 0:
      print("Yes")
      break

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = input().split()
if int(a[1]) % 2 != 0:
    print('No')
elif int(a[0]) * 4 == int(a[1]) or int(a[0]) * 2 == int(a[1]):
    print('Yes')
elif 2 * int(a[0]) >= int(a[1]) and 2 * int(a[0]) - int(a[1]) / 2 >= 1:
    print('Yes')
elif 2 * int(a[0]) - int(a[1]) / 2 >= 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
X, Y=map(int,input().split())

crit=4*X-Y

ans="No"
if crit>=0 and int(crit)==crit:
  ans="Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
mn = y // 4
mx = y // 2

if x >= mn and x <= mx:
    print('Yes')
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]
print(a, b)
if (a*2<=b and a*4>=b) and b%2==0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans_1 = x * 4 #12
ans_2 = ans_1 - y #4

if ans_2 >= 0:
    for i in range(0, x):
        ans_2 = ans_2 - 2

    if ans_2 <= 0:
            print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = n*4

r = k-m

if(r == 0):
    print("Yes")
else:
    if(r >= 0):
        if(r/2):
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

y = Y/2 - X 
x = X - y

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

Submission status: Wrong Answer

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

print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
x,y=n.split()
c=(4*int(x)-int(y))/2
t=int(x)-c
if c.is_integer and 100>=c>=0 and 100>=t>=0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

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

A = np.matrix([
    [1, 1],
    [2, 4]
])

N = np.matrix([
    [X],
    [Y]
])

if int(np.linalg.solve(A, N)[0,0]) >=0 and int(np.linalg.solve(A, N)[1,0]) >=0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = b//4
d = b%4
e = d//2
if c+e== a:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nl / (nb * 4) > nb:
    print('No')
    return
  if (nl % (nb * 2)) % 2 == 0:
    print('Yes')
  else:
    print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
import itertools
x, y = map(int, input().split())
num = [i for i in range(1, x + 1)]
comb = list(itertools.combinations(num, 2))
if y % 4 == 0 and y // 4 == x:
    print("Yes")
    exit()
elif y % 2 == 0 and y // 2 == x:
    print("Yes")
    exit()
for j in comb:
    if j[0] * 4 + j[1] * 2 == y:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for t in range(101):
    if 2*x+2*t == y :
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

b=abs(y-2*x)
if b==0:
  print('Yes')
elif y >=b/2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
x, y = list(map(int, input().strip().split()))
#z = 2 * a + 4 * (x - a)
a = (4 * x - y) / 2
if isinstance(a, int):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

        

if len(z)>0:
    print('YES')

if len(z)<=0:
    print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (2*x < y) or (4*x < y) or (y == 0):
    print("No")
    exit()

if (y % 6 == 2) or (y % 6 == 4) or (y % 6 == 0):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if x > 0 and x.is_integer():
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
c = input()
c = c.split(' ')
x = int(c[0])
y = int(c[1])
sa = y - 2 * x
if sa % 4 == 0 and sa >= 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def main():

        X, Y = list(map(int, input().split()))
        ans = 'No'

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

        return ans

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if a*4>=b:
    if b%2==1:
        print('No')
    else:
        print('Yes')