Problem:


Score : 200 points

Problem Statement

There are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.

Takahashi says: "there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.

Constraints

1 \leq X \leq 100

1 \leq Y \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.

Sample Input 1

3 8

Sample Output 1

Yes

The statement "there are 3 animals in total in the garden, and they have 8 legs in total" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.

Sample Input 2

2 100

Sample Output 2

No

There is no combination of numbers of cranes and turtles in which this statement is correct.

Sample Input 3

1 2

Sample Output 3

Yes

We also consider the case in which there are only cranes or only turtles.



Sample input:
3 8


Sample output:
Yes

Submission status: Accepted

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

#print(x, y)
leg_turtle = 4
leg_clane = 2

if y > x * leg_turtle:
    print("No")
    exit()
elif y < leg_clane * x:
    print("No")
    exit()


for i in range(x + 1):
    clane = i
    turtle = x - i
    #print(clane, turtle)

    legs = 2 * clane + 4 * turtle

    if legs == y:
        print("Yes")
        exit()
    else:
        continue
print("No")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if Y % 2 != 0:
    print('No')
elif 2*X > Y:
    print('No')
elif 4*X < Y:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import math
#import sys
#input = sys.stdin.readline

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ZipArray(a):
    aa = [[a[i],i]for i in range(n)]

    aa.sort(key = lambda x : x[0])
    for i in range(n):
        aa[i][0]=i+1
    aa.sort(key = lambda x : x[1])
    b=[aa[i][0] for i in range(len(a))]
    return b

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

def Zeros(a,b):
    if(b<=-1):
        return [0 for i in range(a)]
    else:
        return [[0 for i in range(b)] for i in range(a)]

def AddV2(v,w):
    return [v[0]+w[0],v[1]+w[1]]

dir4 = [[1,0],[0,1],[-1,0],[0,-1]]


def clamp(x,y,z):
    return max(y,min(z,x))

class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i
            
#
def Zaatsu(a):
    a.sort()
    now = a[0][0]
    od = 0
    for i in range(n):
        if(now==a[i][0]):
            a[i][0]=od
        else:
            now = a[i][0]
            od+=1
            a[i][0] = od
    
    a.sort(key = lambda x : x[1])
    return a

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)


'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 2
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

'''

def rl(x):
    return range(len(x))

# a = list(map(int, input().split()))

#################################################
#################################################
#################################################
#################################################

#31-

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

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if Y<X:
    print("No")
    exit()

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

A = (Y-2*X)/2

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

print("No")

Submission status: Accepted

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 is_integer_num(turtle) and turtle >= 0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
num=[]
num=input().split(" ")
atama=int(num[0])
ashi=int(num[1])

count=0
for i in range(atama+1):
    if 2*(atama-i)+4*i == ashi:
        print("Yes")
        break
    else:
        count=count+1
    
    if count == atama+1:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
count=0
for x1 in range(X+1):
    for x2 in range(X+1):
        if x1+x2<=X and x1+x2>=X:
            if (x1*2)+(x2*4)==Y: count+=1
if count!=0: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
import math


X,Y=map(int, input().split())
if math.isclose(-Y/2+2*X, math.ceil(-Y/2+2*X)) and math.isclose(Y/2-X, math.ceil(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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = (int(x) for x in input().split())
flag = False
for i in range(X):
    a = X - i
    b = i
    if (a*4)+(b*2) == Y:
        flag = True
    else:
        pass
    a = i
    b = X - i
    if (a*4)+(b*2) == Y:
        flag = True
    else:
        pass
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

tsuru = 1
kame = 1
flag = False

for tsuru in range(100):
    for kame in range(100):
        if tsuru + kame == x:
            if (tsuru*2 + kame*4) == y:
                flag = True
                break
    else:
        continue
    break


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print("Yes" if (lambda a: [i*2 for i in range(a[0]+1)].count(a[1]-2*a[0]))(list(map(int,input().split()))) else "No")

Submission status: Accepted

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

Submission status: Accepted

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


if Y % 2 != 0:
  print("No")
elif X*4 >= Y >= X*2:
  print("Yes")
else:
  print("No")
#

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
ans = 0
for i in range(X+1):
    cranes = i
    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: Accepted

Solution code:
import sys

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

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

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

if Y < X:
    print("No")
    sys.exit()

print("No")

Submission status: Accepted

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

for t in range(x+1):
  if t*2+(x-t)*4==y:
    print("Yes")
    c=1
    break
if c==0:
	print("No")

Submission status: Accepted

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

if y%2 == 1:
    print('No')
elif 4 * x < y:
    print('No')
elif 2 * x > y:
    print('No')
else:
    for i in range(0,x+1):
        # print("i:{}".format(i))
        if 2 * i + 4 * (x-i) == y:
            print('Yes')
            break
    else:
        print('No')

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
if i[1]%2 == 1 or i[1] == 0:
  print('No')
  exit()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
f=0
for i in range(x+1):j=x-i;f|=i*2+j*4==y
print('NYoe s'[f::2])

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
A = [2]*X
ans = 'No'
if X==1 and Y==4 or X==25 and Y==100:
    ans='Yes'
else: 
    for i in range(X):
        if sum(A)==Y:
            ans = 'Yes'
            break
        A[i]=4
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for k in range(x+1):
    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: Accepted

Solution code:

x, y = [int(x) for x in input().split()]
a = b = 0
flag = False
for i in range(x + 1 // 2):
    a = x - i
    b = x - a
    if 4 * a + 2 * b == y or 4 * b + 2 * a == y:
        flag = True
        break
print("Yes" if flag else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    if 4*x - y < 0 or y - 2*x < 0:
        print("No")
    else:
        c = (4*x - y) / 2
        t = (y - 2*x) / 2
        
        if c==int(c) and t==int(t):
            print("Yes")
        else:
            print("No")
    

if __name__ == "__main__":
    main()

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
def main():
  c = input()
  c = c.split(' ')
  x = int(c[0])
  y = int(c[1])

  for i in range(0, 100):
    turu = i * 2
    for j in range(0, 100):
      kame = j * 4
      if turu + kame == y and i + j == x:
        print('Yes')
        return
  print('No')
  
if __name__ == "__main__":
  main()

Submission status: Accepted

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

a = 0
b = 0
det = 2
a = (4 * x - y) / det
b = (-2 * x + y) / det


if a < 0 or b < 0 or y % 2 == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
x,y= map(int,input().split())
l =[]
for i in range(101):
    if i % 2 ==0 :
        l.append(i)
if x*2 <= y <= x*4 and y in l:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

for i in range(x + 1):
    total = 2 * i + 4 * (x - i)
    if y == total:
        print('Yes')
        flag = 1
        break
    
if flag == 0:
    print('No')

Submission status: Accepted

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

if y%2 == 1:
    print("No")
else:
    crane = (x*4 - y)//2
    turtles = x - crane

    if crane + turtles != x or crane < 0 or turtles < 0:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

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

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

if turu.is_integer() and turu >= 0 and kame.is_integer() and kame >=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

n , total = map(int,input().split())
t = 0
k = 0

for t in range(n + 1):
    for k in range(n + 1):
        x = t + k
        if x == n:
            if 2*t + 4*k == total:
                print("Yes")
                sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
 
if y % 2 == 1 or x * 4 < y:
    print("No")
    exit() 

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

print("No")

Submission status: Accepted

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) or nl == 0 or nb > nl or (nl / 4.0) > nb:
    print('No')
    return
  for i in range(nb + 1):
    if ((nb - i) * 4 + i * 2) == nl:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

Submission status: Accepted

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 = np.diag(np.fliplr(cranes + turtles))


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

Submission status: Accepted

Solution code:
x, y = map(int, input().split(' '))
found = False
for i in range(x+1):
    for j in range(x+1):
        if i+j == x and (2*i+4*j == y or 2*j+4*i == y): found = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    #CODE GOES HERE:
    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: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = list(map(int, input().split()))
a = x[0]
b = x[1]
ans = []

ans = [2*(a-i)+4*i  for i in range(a+1)]

if b in ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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


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

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


	else:
		print("Yes")

Submission status: Accepted

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

        x = sum - i

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

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x+y for (x, y) in zip(lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# n = int(input())
in_data = [int(x) for x in input().split(' ')]
x = in_data[0]
y = in_data[1]
result = 'No'

patterns = []

for i in range(x+1):
  patterns.append(2*i + 4*(x-i))
    

if y in patterns:
  result = 'Yes'
    
print(result)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
a = 0
output = 'No'
if Y%2 != 0:
    pass
else:
    while X >= 0:
        b = X*2 + a*4
        if b == Y:
            output = 'Yes'
        X -= 1
        a += 1
print(output)

Submission status: Accepted

Solution code:
print("Yes" if (lambda a: [i*2+(a[0]-i)*4 for i in range(a[0]+1)].count(a[1]))(list(map(int,input().split()))) else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
l=[]
for i in range(x+1):
  l.append(2*(x+i))
  i+=1
print('Yes' if y in l else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

c = 0

while x >= 0:
    if c * 2 + x * 4 == y:
        break
    c += 1
    x += -1
else:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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 or (x - i) * 2 + i * 4 == y:
      flg = 0
      break
print('Yes' if flg == 0 else 'No')

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

  Tsuru = 2*X
  if Tsuru > Y:
    print('No')
  else:
    if Tsuru == Y:
      print('Yes')
    else:
      for i in range(X):
        Tsuru += 2
        if Tsuru == Y:
          print('Yes')
          exit()
        else:
          pass
      print("No")
      

if __name__ == '__main__':
  main()

Submission status: Accepted

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 and turuNum >= 0):
            print("Yes")
        else:
            print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print("{}".format(ret))

Submission status: Accepted

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

if Y%2 != 0:
    print('No')
elif X*2 > Y:
    print('No')
elif X*4 >= Y:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
make=False
def check_possible(req,num):
  for i in range(0,req+1):
      for j in range(0,req+1):
          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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

turu_all = 2 * x
a = y - turu_all
kame = a / 2
turu = x - kame

if x == turu + kame:
    ans = "Yes"
    if turu < 0 or kame < 0 or a%2 != 0:
        ans = "No"

print(ans)

Submission status: Accepted

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")
		break
else:
	print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
ret='No'
if Y%2==0 or Y<=4*X or Y>=2*X:
    for i in range(0,X+1):
        #print('turu:' + str(2*i) + ' kame:' + str(4*(X-i)))
        if (2*i)+(4*(X-i))==Y:
            ret='Yes'
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def is_odd(num):
    if num % 2 == 0:
        return False
    else:
        return True


if is_odd(ans):
    print('No')
elif ans/2 <= x:
    if ans/2 < 0:
        print('No')
    else:
        print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

add = 0
flag =0

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

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

Submission status: Accepted

Solution code:
n,a=map(int,input().split())
if a > 4*n or a < 2*n or a%2 != 0:
  print("No")
elif n >= -((-a/2)//2):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
atama, asi = [int(x) for x in input().split()]
if asi%2 == 0 and asi >= atama*2 and asi <= atama*4:
    print("Yes")
else:
    print("No")

# 足の総数は常に偶数
# 鶴が多いほど、少ない足で頭数を揃えられる
# 亀が多いほど、頭数に対して足の数が必要

Submission status: Accepted

Solution code:
def animal(x,y):
    if x*4==y or x*2==y:
        return "Yes"
    for i in range(1,x+1):
        if ((x-i)*4 + i*2) == y:
            return "Yes"
    return "No"

if __name__ == "__main__":
    x,y = map(int,input().split())
    print(animal(x,y))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
c=0
for i in range(0,x+1):
    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")