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:
x, y = map(int, input().split())
count = 0
if y%2 == 0:
    while y >= 2:
        if y >= 2:
            if y%2 == 0:
                y = y/2
                count += 1
            elif y%2 != 0:
                count = 0
                break
        elif y == 2:
            count += 1
            break
else:
    print("No")

if count == x:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
input = input().split(" ")
numa = int(input[0])
numl = int(input[1])
turu = list()
kame = list()
if numa == 1:
  numa+=1
for a in list(range(numa)):
  turu.append(a*2)
for b in list(range(numa)):
  kame.append(b*4)
kame.reverse()
#print(turu, kame)
for c in list(range(numa)):
  cmo = c-1
  tot = turu[int(cmo)] + kame[int(cmo)]
  if tot == numl:
    print("Yes")
    exit()
  else:
    continue
print("No")

Submission status: Wrong Answer

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

crane = (4 * X - Y) / 2
turtle = (Y - 2 * X) / 2


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


if is_integer_num(crane) and crane >= 0 and crane + turtle == X:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

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

if y > a :
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
x = input().split(' ')

def rcv(len, sum):
  if len == int(x[0]):
    return sum == int(x[1])
  elif sum-3 >= int(x[1]):
    return False
  else:
    return rcv(len+1, sum+2) or rcv(len+1, sum+4)

result=False
if int(x[1])-(int(x[0])*4) < 0 and int(x[1])%2==0:
  result = rcv(0, 0)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())
    
    if leg / sum == 2:
        print('Yes')
        return
    elif leg / sum == 4:
        print('Yes')
        return

    for i in range(sum + 1):
        for x in range(sum - i):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()

Submission status: Wrong Answer

Solution code:
import sys

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

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

if X == 1:
    if Y == 4 or Y == 2:
        print("YES")
        sys.exit()

print("NO")

Submission status: Wrong Answer

Solution code:
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

ans = "No"
flag = False
x , y = map(int, read().split())

for i in range(x+1):
  for j in range(x+1):
    tmp = i*4 + j*2
    if tmp is y:
      flag = True
      ans = "Yes"
      break
    elif tmp > y:
      break
  if flag is True:
    break


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
if Y % 2 !=0:
    a = "NO"
else:
    t = 2*X-Y/2
    k = Y/2-X
    if int(t)<0 or int(k)<0:
        a = "NO"
    else:
        a = "YES"
print(a)

Submission status: Wrong Answer

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

turu = 2
kame = 4

flag =0
for x in range(a + 1):
    for y in range(a + 1):
        if turu * x + kame * y == b and x + y <= a:
            flag +=1

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

Submission status: Wrong Answer

Solution code:
def main():
    x,y=map(int,input().split())
    if y%2!=0:print("NO")
    else:
        flag=True
        for i in range(x+1):
            if (2*i)+4*(x-i)==y:print("YES");flag=False;break
        if flag:print("NO")
main()

Submission status: Wrong Answer

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

if (b-2*a)%2==0:
    if(2*a-b)%2==0:
      print('YES')
    else:
      print('No')
    
else:
  print('No')

Submission status: Wrong Answer

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

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

if (a+b) == X:
    pass 
    if (2*a+4*b) == Y:
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

key = y - x * 2
if key >= 0:
    if key % 2 == 0 and (x - key // 2) >= 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:
a = input().split(" ")
i = 0
l = int(a[0])
s = int(a[1])
while (i < l) and (l < s) :
    if s - 4 >= 0 :
        s = s - 4
    if (s - 2 >= 0) and (s - 4 <= 0) :
        s = s - 2
    if s == 0 :
        print("Yes")
        break
    i = i + 1
if (s != 0) and (l < s) :
    print("No")
if (s >= l) :
    print("No")

Submission status: Wrong Answer

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

turu = 2
kame = 4
flag =0

for x in range(a):
    for y in range(a):
        if turu * x + kame * y == b and x + y <= a:
            flag +=1
if flag > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())
    
    if leg / sum == 2:
        print('Yes')
        return
    elif leg / sum == 4:
        print('Yes')
        return

    for i in range(sum + 1):
        for x in range(sum - i + 1):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
e = 0
temp_X = X
while temp_X >= 0:
    i = (temp_X*2) + (e*4)
    if i == Y:
        print("Yes")
        quit()
    temp_X -= 1
    e += 1
print("No")
if Y%2 != 0:
    print("No")
    quit()

Submission status: Wrong Answer

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

ans = []
for x in range(0,51):
    if Y == 4*x + 2*(X-x):
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = list(map(int, input().split()))
count = 0
if Y%2 == 0:
    while Y >= 2:
        if Y >= 4:
            if Y%4 == 0:
                Y = Y/4
                count += 1
            elif Y%4 != 0:
                count = 0
                break
        elif Y == 2:
            count += 1
            break
else:
    print("No")

if count < X-2 or count > X or count == 0:
    print("No")
if count == X-1 or count == X:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
e = 0
temp_X = X
while temp_X >= 0:
    i = (temp_X*2) + (e*4)
    if i == Y:
        print("Yes")
        quit()
    temp_X -= 1
    e += 1
print("No")
if Y%2 != 0:
    print("No")

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

X, Y = map(int, input().split())
 
left = [[1, 1],
        [2, 4]]
 
right = [X, Y]

if (int(solve(left, right)[0]) == 0 and int(solve(left, right)[1]) == 0) or solve(left, right) is None:
  print("No")
elif int(solve(left, right)[0]) < 0 or int(solve(left, right)[1]) < 0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

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

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

if X == 1:
    if Y == 4 or Y == 2:
        print("YES")
        sys.exit()

print("NO")

Submission status: Wrong Answer

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

for i in range(1,x+1) :
    if i*4 == y or i*2 == y or i*4+i*2 == y :
        print("Yes")
        count+=1
        break;

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

Submission status: Wrong Answer

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

ans = []
for x in range(0,51):
    if Y == 4*x + 2*(X-x-1):
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
[x, y] = [x for x in map(int, input().split(' '))]
flg = -1
if y % 2 == 1:
  flg = 1
else:
  for i in range(0, x):
    if i * 2 + (x - i) * 4 == y:
      flg = 0
      break
if flg == 1 or flg == -1:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def check_possible(req,num):
  for i in range(1,req):
      for j in range(1,req):
          if 2*i+4*j==num and i+j==req:
              return True
  return False
req,num=list(map(int,input().split()))
if check_possible(req,num):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

cranes = np.arange(X+1) * 2
turtles = (np.arange(X+1)*4).reshape(-1,1)

total = cranes + turtles

for i in range(len(total)):
  if i == 0:
    pass
  else:
    total[i][-i:] = 0

if np.any(total == Y):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

ans = []
for x in range(1,51):
    if Y == 4*x + 2*(X-x-1):
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

crane = (4 * X - Y) / 2
turtle = (Y - 2 * X) / 2


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


if is_integer_num(crane) and crane >= 0:
    print("Yes")

elif is_integer_num(turtle) and turtle >= 0:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if (4*X - Y) < 0:
    print("No")
elif (4*X - Y)%2 == 0:
    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:
x , y = map(int , input("").split())
a = 2*x
b = y - a
c = b//2
d = x - c
if y % 2 != 0 :
    print("No")
elif y < x :
    print("No")
elif d < 0 :
    print("No")
else :
    print("Yes")

Submission status: Wrong Answer

Solution code:
x, y = list(map(int, input().split()))
yes = "Yes"
no = "No"

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

print(ans)

Submission status: Wrong Answer

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

turu = 2
kame = 4

flag =0
for x in range(a):
    for y in range(a):
        if turu * x + kame * y == b and x + y <= a:
            flag +=1

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

Submission status: Wrong Answer

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

ans = []
for x in range(1,26):
    if Y == 4*x + 2*(X-x-1):
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    souwa,ashi=map(int,input().split())
    if souwa*2==ashi or souwa*4==ashi:
        print('Yes')
    else:
        turu=(ashi-souwa*2)
        if turu<0:
            print('No')
            return
        kame=turu/2
        turu=souwa-kame
        if turu<0:
            print('No')
            return
        if kame+turu==souwa:
            print('Yes')
        else:
            print('No')
if __name__ == "__main__":
    main()
#12 31

Submission status: Wrong Answer

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

crane = (x*4 - y)//2
turtles = x - crane

if isinstance(crane, float) or crane < 0 or turtles < 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())

for i in range(1, N+1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
a = 0
b = 0
flag = True
while flag:
    for a in range(x+1):
        print(a)
        for b in range(x+1):
            if x - a == b and y - 2*a == 4*b:
                flag = False
                print(a,b,x,y)
                break
            else:
                continue
    break

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

Submission status: Wrong Answer

Solution code:
import math


X,Y=map(int, input().split())
if math.isclose(-Y//2+2*X, round(-Y//2+2*X)) and math.isclose(Y//2-X, round(Y//2-X)):
    if Y//2-X>0 and -Y//2+2*X>0:
        print("Yes")


    elif Y//2-X==0 and -Y//2+2*X>0:
         print("Yes")


    elif Y//2-X>0 and -Y//2+2*X==0:
         print("Yes")

    else:
         print("No")


else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if X*4 < Y or X*2 > Y or Y % 2 != 0:
  print('no')
  exit()

if (Y/2-X).is_integer():
  if Y/2-X < X:
    print('yes')
    exit()
print('no')

Submission status: Wrong Answer

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

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

a = (Y-2*X)/2

if X-a >= 0:
    print("Yes")
    exit()

print("No")

Submission status: Wrong Answer

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

x = 1/2*(i[1]-2*i[0])
print(x)

if x < i[0] and x.is_integer():
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

crane = (4 * X - Y) / 2
turlte = (Y - 2 * X) / 2


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


if is_integer_num(crane) and crane >= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    souwa,ashi=map(int,input().split())
    if souwa*2==ashi or souwa*4==ashi:
        print('Yes')
    else:
        turu=(ashi-souwa*2)
        if turu<0:
            print('No')
            return
        kame=turu/2
        turu=souwa-kame
        if turu<0:
            print('No')
            return
        if kame+turu==souwa:
            print('Yes')
        else:
            print('No')
        print(kame,turu)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

res = 0
s = ''
for i in range(a[0]):
    if a[0] * 4 < a[1] or a[0] * 2 > a[1]:
        s = 'No'
        break
    if (a[0] == i + 1) and (res + 2 == a[1] or res + 4 == a[1]):
        s = 'Yes'
    if (a[0] - i) * 4 > a[1] and ((res + 4) + ((a[0] - i + 1) * 2) > a[1]):
        res += 2
        continue
    else:
        res += 4
        continue
if s == '':
    s = 'No'
print(s)

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())
    
    for i in range(sum):
        for x in range(sum - i):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

array = []
for i in range(X):
    legs = (2*(i+1))+(4*(X-(i+1)))
    array.append(legs)

if Y in array:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
a = 0
b = 0
flag = True
while flag:
    for a in range(x+1):
        print(a)
        for b in range(x+1):
            if x - a == b and y - 2*a == 4*b and b != 0 and a != 0:
                flag = False
                print(a,b,x,y)
                break
            else:
                continue
    break

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  x, y = map(int, input().split())
  
  count = 0
  
  for i in range(x+1):
    hui = i*2+(x-i)*4
    if hui == y:
      count += 1
      
    else:
      count += 0
      
  if count>0:
    print('YES')
  else:
    print('NO')
main()

Submission status: Wrong Answer

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


hiki = arr[0]
foot = arr[1]


if foot%2==1:
    print("No")
elif hiki*4<foot:
    print("No")
elif hiki*2>foot:
    print("No")
else:
    for turu in range(1,hiki+1):
        if((foot - turu*2)/4==hiki-turu):
            print("Yes")
            break;
        elif(turu==hiki):
            print("No")

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

X, Y = map(int, input().split())
 
left = [[1, 1],
        [2, 4]]
 
right = [X, Y]

if int(solve(left, right)[0]) == 0 and int(solve(left, right)[1]) == 0:
  print("No")
elif int(solve(left, right)[0]) < 0 or int(solve(left, right)[1]) < 0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

    if((4 * X) < Y):
        print("No")
    else:
        turuNum = (Y - 2 * X) / 2
        kameNum = X - turuNum

        if(turuNum.is_integer() and kameNum >= 0):
            print("Yes")
        else:
            print("No")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a=list(range(2*A,4*A,2))
if (B in a) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

array = []
for i in range(X):
    legs = (2*(i+1))+(4*(X-(i+1)))
    array.append(legs)

if Y not in array:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

a = 2 * x
b = y - a 
c = b // 2
ans = (x-c) + c


if(ans == x and (x-c) >= 0):
    print("Yes")
elif(x == 1 and y == 2 or y == 4):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X ,Y = map(int,input().split())
if X > 50:
    print('No')
    exit(0)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1,x+1) :
    if i*4 == y or i*2 == y :
        print("Yes")
        count+=1
        break;
        
if count == 0 :
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
  x, y = map(int, input().split())
  
  count = 0
  
  for i in range(x+1):
    hui = i*2+(x-i)*4
    if hui == y:
      count += 1
      break
    else:
      count += 0
  if count>0:
    print('YES')
  else:
    print('NO')
main()

Submission status: Wrong Answer

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

if x == 1:
    if y == 2 or y == 4:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

if not y % 2 == 0:
    print('No')
    exit()
    
if y > 4*x:
    print('No')
    exit()
elif y//4 == x:
    print('Yes')
    exit()

for i in range(x):
    if (y-i*2)%((x-i)*4) == 0:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())

    if sum > leg:
        print('No')
    
    if leg / sum == 2:
        print('Yes')
        return
    elif leg / sum == 4:
        print('Yes')
        return

    for i in range(sum):
        for x in range(sum - i):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
count = 0
if y%2 == 0:
    while y >= 2:
        if y >= 4:
            if y%4 == 0:
                y = y/4
                count += 1
            elif y%4 != 0:
                count = 0
                break
        elif y == 2:
            count += 1
            break
else:
    print("No")

if count < x-2 or count > x or count == 0:
    print("No")
if count == x-1 or count == x:
    print("Yes")

Submission status: Wrong Answer

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


hiki = arr[0]
foot = arr[1]


if foot%2==1:
    print("No")
elif hiki*4<foot:
    print("No")
elif hiki*2>foot:
    print("No")
else:
    for turu in range(1,hiki+1):
        if((foot - turu*2)/4==hiki-turu):
            print("Yes")
            break;

Submission status: Wrong Answer

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

add = 0
flag =0

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

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

Submission status: Wrong Answer

Solution code:
from itertools import combinations
x,y = map(int,input().split())
arr = []
c = '4'*(x) + '2'*(x)
comb1 = set(combinations([int(i) for i in c],x))
print(comb1)
for i in comb1:
    arr.append(sum(i))
if y in arr:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

array = []
for i in range(X):
    legs = (2*(i+1))+(4*(X-(i+1)))
    array.append(legs)

if Y not in array:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

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

crain = (4 * b - a) / 2
if crain.is_integer() and crain > 0:
    crain = int(crain)
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = y/2-x
p = -y/2+2*x

if k > -1 and p > -1 and k*4+2*p == y and x!=y: print("Yes")
else: print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
if a[1] % 2 == 1 :
  print("NO")
else :
  if a[0] * 2 <= a[1] and a[0]*4 >= a[1] :
    print("YES")
  else :
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    X, Y = map(int, input().split())
    
    sets_2 = {i * 2 for i, _ in enumerate(range(X), start=1)}
    sets_4 = {i * 4 for i, _ in enumerate(range(X), start=1)}
    
    result = map(lambda x: x - Y, sets_2 | sets_4)

    print('YES' if any(x==0 for x in result) else 'NO')

main()

Submission status: Wrong Answer

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

print("No")

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
z = y - x*2
if z//2 == 0:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
lst= []
if x == 1 and y == 2 :
    print("Yes")
elif x == 1 and y == 4 :
    print("Yes")
else:
    for i in range(1,100):
        for j in range(1,100):
            if i + j == x :
                if (i*2) + (j*4) == y :
                    print("Yes")
                    lst.append("a")
                    exit()
                elif (i*4) + (j*2) == y :
                    print("Yes")
                    lst.append("b")
                    exit()
    if len(lst) == 0 :
        print("No")

Submission status: Wrong Answer

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

for x in range(A1):
  y = A2-2
  if y <=4:
    break

ans = A2-(A1-x)*4
if ans == 4:
  print("Yes")
elif ans == 0:
    print("Yes")
elif ans == -2:
    print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a = input().split(" ")
i = 0
l = int(a[0])
s = int(a[1])
r = s
while (i < l):
    if (l >= s) and (i == 0) :
        print('No')
        break
    if (s - 4 >= 0):
        s = s - 4
    if (s - 2 >= 0) and (s - 4 <= 0) :
        s = s - 2
    if s == 0 :
        print("Yes")
        break
    i = i + 1
if (s != 0) and l < r:
    print("No")

Submission status: Wrong Answer

Solution code:
l=list(map(int,input().split()))
n=l[0]
legs=l[1]
if(l[1]%2!=0):
    print("No")
if(l[1]%2==0 and l[0]*4>=l[1] and l[0]*2<=l[1]):
    print("Yes")
if(l[0]==l[1] and l[1]==0):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

print("No")