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:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

Submission status: Wrong Answer

Solution code:
def do():
    n,m=map(int,input().split())
    if n==1 and m==2 or m==4:
        return "Yes"
    for i in range(1,n):
        for j in range(1,n):
            if j+i==n:
               if (4*i)+(2*j)==m:
                   return "Yes"
    return "No"


print(do())

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)

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

if y == 2 or x ==0 :print('No');exit()
if y%2 :print('No');exit()
if (y//2==x and y%2 ==0 ) : print('Yes');exit()
if (y//4==x and y%4 ==0 ) : print('Yes');exit()

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

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

print('No')

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
if A[1]/2 <= A[0]:
    print("Yes")
elif A[1]/4 <= A[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):
    cranes = i + 1
    turtles = X - cranes
  
    if cranes*2+turtles*4 == Y:
        ans += 1
        break

if ans >= 1:
    print("Yes")
elif X == 0 and Y == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if ((Y//X) + ((Y*2)//X)) == X:
    print("Yes")
elif X == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

turu = (4 * X - Y) / 2
kame = Y - turu

if turu.is_integer() and turu > 0:
    if kame.is_integer() and kame > 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 np.linalg.solve(A, N) is None:
  print("No")
elif 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 = tuple(map(int, input().split()))

a = y // 4
b = y % 4

c = b // 2
d = b % 2

if a + c <= x and d == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = y - 2*x
if a > x:
    print("No")
elif a < 0:
    print("No")
elif a % 2 == 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 is False or t.is_integer is False or 100<c or c<0 or (c==0 and t==0):
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
flag = 0
for tsuru in range(a, 0, -1):
    if 2*tsuru + 4*(a-tsuru) == b:
        flag = 1

if a>100 or b>100:
    flag = 0

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

Submission status: Wrong Answer

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

total_min = 2 * animal
total_max = 4 * animal

is_yes = False
if total_min <= foot <= total_max:
    for a in range(animal):
        total = (a+1) * 2 + (animal - (a+1)) * 4
        if total == foot:
            print("Yes")
            is_yes = True
            break
    if is_yes == False:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

if 4*x - y >= 0 and (4*x - y) % 2 == 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):
        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())
kame = 4
turu = 2
all_turu = turu * X
change = kame - turu
remaining = Y - all_turu
kame_num = remaining // change
if (X - kame_num) < 0:
    print('No')
elif (kame_num) < 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 m == 0:
  print("No")
elif b<0:
  print("No")
elif a == 0:
  if b + (l-b) == l:
    print("Yes")
  else:
    print("No")
else:
    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):
        ans=2*j+4*i
        if ans==y:
            print('Yes')
            sys.exit()
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")
elif x == 0 and y > 0 and y.is_integer():
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

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

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

N, M = map(int,input().split())
for i in range(1, N+1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

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

while x>0:
    
    if y>=4:
        y=y-4
        x=x-1
    if y>=2:
        y=y-2
        x=x-1
    
    if y==0:
        break
    

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

Submission status: Wrong Answer

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

for i in range (0,x + 1):
  z = 2*i + 4 * (x-i)
  if z == y:
    print('YES')
    break
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
import sys

x, y = map(int, input().split())
x *= 2
y -= x

if(y % 2 == 1):
  print('No')
  sys.exit()

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=(int(x) for x in input().split())
1<=x<=100
1<=y<=100
z=y/x
if y>x*6:
    print('No')
elif y<x*2:
    print('No')
elif y%2==1:
    print('No')
elif y==4 and x==1:
    print('No')
elif z%1==1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
num = A
con = 0
while True:
    if (B < 0):
        print('No')
        break
    if (A == 0 and B == 0):
        print('Yes')
        break
    if (A == 0):
        while True:
            if (A > num or B < 0):
                print('No')
                break
            if (B == 0):
                print('Yes')
                break
            B = B - 2
            A + 1
            con += 1
    B = B - 2
    A - 1

Submission status: Wrong Answer

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

tsuru = (x-2*y)/2
kame = (4*y-x)/2
if tsuru < 0 or kame < 0:
  print('no')
elif (x-2*y)%2 == 0 and (4*y-x)%2 == 0:
  print('Yes')
else:
  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 i * 2 + j * 4 == y:
            print('Yes')
            sys.exit()
        else:
            continue
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 == 2:
    if x > mn and x <= mx:
        print('Yes')
    else:
        print('No')
elif x >= mn and x <= mx:
    print('Yes')
else:
    print("No")

Submission status: Wrong Answer

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


a = 2*X - Y/2


if a >= 0 and isinstance(a, int):
  print("Yes")
else:
  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):
        ans=2*j+4*i
        if ans==y:
            print('YES')
            sys.exit()
print('NO')

Submission status: Wrong Answer

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

if y%2 == 1 or 2*x < y:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x and z%2==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 = 2*i
  b = 4*(x-i)
  f = a+b
  if  f == int(y):
    if x == (int(a/2)+int(b/4)):
      print('Yes')
      break
else:
  print('No')

Submission status: Wrong Answer

Solution code:
x , y = map(int , input("").split())
s1 = []
s2 = []
s3 = []
for i in range(x+1):
    s1.append(i)
    s2.append(x-i)
for k in s1 :
    for p in s2 :
        s3.append ((k*2) + (p*4))

if y in s3 :
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if y % 2 == 0 and 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:
l,m = map(int,input().split())
a = 0
b = 0

mm = l*4

a = (mm - m) % 2
b = (mm - m) // 2
if b<0:
  print("No")
elif a == 0:
  if b + (l-b) == l:
    print("Yes")
  else:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

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

tsuru = (x-2*y)/2
kame = (4*y-x)/2
if tsuru < 0 or kame < 0:
  print('no')
elif (x-2*y)%2 == 0 and (4*y-x)%2 == 0:
  print('yes')
else:
  print('no')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

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

left = [[2, 4],
        [1, 1]]
 
right = [int(Y), int(X)]
 
Ans = solve(left, right)

if Ans[0].is_integer() == True and Ans[1].is_integer() == True:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

min, max = 0, 0

kq, kmod = divmod(y, 4)
tq, tmod = divmod(kmod, 2)
if tmod != 0:
        print('No')
else:
        min = kq + tq

t2q, t2mod = divmod(y, 2)
if t2mod != 0:
        print('No')
else:
        max = t2q

if x <= max and x >= min:
        print('Yes')
else:
        print('No')

Submission status: Wrong Answer

Solution code:
import sys
X, Y = map(int,input().split())
list1 = []
list2 = []

for x in range(0,101):
  for y in range(0,101):
    list1.append(x+y)
    list2.append(2*x+4*y)


for i in list1:
  if list1[i] == X and list2[i] == Y:
    print('Yes')
    sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
diff = Y - X*2
quo, remain = divmod(diff, 2)
if remain == 0:
  if quo > X:
    print('No')
  elif quo <= X:
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = y - 2*x
if a > x:
    print("No")
elif a % 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,1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
        print('Yes')
        break
    elif N == M:
        print('No')
        break
    elif N >= M:
        print('No')
        break
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range (0,x + 1):
  z = 2*i + 4 * (x-1)
  if z == y:
    print('YES')
    break
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)

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

if y%2 :print('No');exit()
if (y//2==x and y%2 ==0 ) : print('Yes');exit()
if (y//4==x and y%4 ==0 ) : print('Yes');exit()

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

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

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


q, mod = divmod(foot, 4)

if foot % 2 ==1:
  print("No")
elif q > N :
  print("No")
elif  q == N and mod >= 2:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
X,Y = map(int, input().split())
 
ans = 0
#つるをi
 
for i in range(X):
  if 2*i ==  4*X - Y and i != 0:
      ans +=1
  elif 2*(i+1) == Y:
      ans +=1
  elif 4*(X-i) == Y:
      ans +=1
 
 
if ans > 0:
  print('Yes') 
else:
  print('No')

Submission status: Wrong Answer

Solution code:

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

c = x
v = y

while x > 0:
    if y - 4 != 0:
        y -= 2
        x-= 1
    else:
        y -= 4
        x -=1


if x == y == 0:
    print ('Yes')
else:
    while c > 0:
        if v - 2 != 0:
            v -= 4
            c-= 1
        else:
            v -= 2
            c -=1

    if c == v == 0:
        print('Yes')
    else:
        print ('No')

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 and a+b==x):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
#%%

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

correct = False

for i in range(1,x):
    for j in range(1,x):
        if i * 4 + ((j - i) * 2) == y:
            correct = True
            break
        else:
            correct = False
            continue
    
if x == 1 and (y == 2 or y == 4):
    correct = True
                         
if correct == True:
    print ("Yes")
else:
    print ("No")

Submission status: Wrong Answer

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

for i in range(b):
  for y in range(b-i):
    if i*2 + y*4 == t:
      a=1
      
if a == 1:
  print("Yes")
elif a == 0:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def do():
    n,m=map(int,input().split())
    k=0
    for i in range(1,n):
        for j in range(1,n):
            if j+i==n:
               if (4*i)+(2*j)==m:
                   return "Yes"
    return "No"


print(do())

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 / 4.0) > 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:
x, y = map(int, input().split())

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

if (turu < 0):
    print("No")
    exit()

if ((y-turu*2) // 4 == kame):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
diff = Y - X*2
quo, remain = divmod(diff, 2)
if remain == 0 and quo >= X:
  print('No')
elif remain == 0 and quo < X:
  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:
l,m = map(int,input().split())
a = 0
b = 0

mm = l*4

a = (mm - m) % 2
b = (mm - m) // 2
if b<0:
  print("No")
elif a == 0 and b + (l-b) == l:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y=(int(x) for x in input().split())
1<=x<=100
1<=y<=100
z=y/x
if y>x*6:
    print('No')
elif y<x*2:
    print('No')
elif y%2==1:
    print('No')
elif y==4 and x==1:
    print('No')
elif z==2 or z==3 or z==4 or z==5 or z==6:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if m % 2 == 0 or m % 4 == 0:
  if (n * 4) >= m:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
x, y = [int(i) for i in input().split()]
print("Yes") if (((2*x)-y)/(-2) > 0 and (y-(4*x))/(-2) > 0) or ( x == 0 and y == 0) else print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if 2*X<=Y<=4*X:
   print('Yes')
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 >= 0 and b >= 0 and isinstance(a, int) and isinstance(b, int):
  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 (i + j) > X:
            pass
        elif S == 0:
            ans = 1
            break
        else:
            pass

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

Submission status: Wrong Answer

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

def search(count, sum):
    #print(count, sum)
    if sum > y or count > x+1:
        return False
    elif sum == y:
        print("Yes")
        exit()

    if search(count+1, sum +2):
        return True
    if search(count+1, sum +4):
        return True
    return False
    """
    count += 1
    #鶴
    sum += 2
    search(count, sum)
    #亀
    sum += 4
    search(count, sum)
    """
search(1, 0)

print("No")

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if Y % 2 == 1:
    print("No")
    sys.exit()

turu = (4 * X - Y) / 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def do():
    n,m=map(int,input().split())
    k=0
    for i in range(1,n):
        for j in range(1,n):
            if j+i==n:
               if (4*i)+(2*j)==m:
                   return "Yes"


print(do())

Submission status: Wrong Answer

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

if m % 2 == 0 or m % 4 == 0:
  if (n * 4) >= m:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(1)] 
li = list(map(int, s[0].split()))
li1 = li[0]
li2 = li[1]
y = ((li2* 10 /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:
import sys 
X,Y = map(int, input().split())
for i in range(101):
    for j in range(101):
        if ((i*2) + (j*3)) == Y and (i+j == X):
            print("Yes")
            sys.exit()
print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
diff = Y - X*2
quo, remain = divmod(diff, 2)
if remain == 0 and quo > X:
  print('No')
elif remain == 0 and quo <= X:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total_min = 2 * animal
total_max = 4 * animal

is_yes = False
if total_min <= foot <= total_max:
    for a in range(animal):
        total = (a+1) * 2 + (animal - (a+1)) * 4
        print(total)
        if total == foot:
            print("Yes")
            is_yes = True
            break
    if is_yes == False:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = input().split(" ")
i = 0
f = 0
l = int(a[0])
s = int(a[1])
if (l * 4 < s) or (s % 2 == 1) :
    f = f + 1
    print("No")
while (i < l) and (f == 0) and (l > 0):
    if (s - 4 >= 0) :
        l = l - 1
        s = s - 4
    if (s - 2 >= 0) and (s - 4 <= 0) :
        l = l - 1
        s = s - 2
    i = i + 1
if s == 0 :
    print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

CR=0
TU=0
X,Y=map(int, input().split())
for i in range(0,X):
    CR=i
    TU=X-i
    if 2*CR+4*TU==Y:
        print("Yes")
        sys.exit()
    else:
        continue
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 % 2 == 0) else 'No')

Submission status: Wrong Answer

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

k = n*4

r = k-m

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

Submission status: Wrong Answer

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

for i in range(l[0]):
  r = (i+1) * 2 + (l[0] - (i+1)) * 4
  if r == l[1]:
    print("Yes")
    break
  else:
    if (i+1) == l[0]:
      print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)

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

if (y//2==x and y%2 ==0 ) : print('Yes');exit()
if (y//4==x and y%4 ==0 ) : print('Yes');exit()

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

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

print('No')

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

x,y = map(int,input().split())
if y % 2 == 0 and (x*4) >= y:
    ans = factorization(y)
    for i,j in ans:
        if i == 2 or i == 4:
            pass
        else:
            print("No")
            exit()
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for _ in range(X):
    if Y - 4 > 0:
        Y = Y - 4
    elif Y - 2 >= 0:
        Y = Y - 2

print('YES' if Y == 0 else '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:
# Xは動物の総数,Yは動物の足の総数
X,Y = map(int, input().split())

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

# まずは鶴が1匹の時だけを判定,奇数は有えないので排除
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:
x, y = map(int, input().split())
d = 'No'

for k in range(1, 100 + 1):
  for t in range(1, 100 + 1):
    if y == 4 * k + 2 * t and x == k + t:
      d = 'Yes'
print(d)

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 ani==1:
    print('No')
elif total % 2==0:
    if 2<=(4*ani-total)<=(2*ani-2):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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