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())
ans = 0

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



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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x, y = map(int, input().split())
for i in range(x+1):
    crane = i
    turtle = x - i
    legs = 2 * crane + 4 * turtle
    if y == legs:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for a in range(100):
    for b in range(100):
        x = a + b
        y = 2 * a + 4 * b
        if x == X and y == Y:
            ans = "Yes"

print(ans)

Submission status: Accepted

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

tsuru = (Y-2*X)/2
kame = X - tsuru

if tsuru >= 0 and kame >=0:
    if tsuru%1 == 0 and kame%1 == 0:
        print("Yes")

    else:
        print("No")

else :
    print("No")

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = list(map(int,input().split()))
z= 0
if b% 2!=0:
    print("No")
    quit()
else:
    while a>=0: 
        c = a*2+z*4
        if c ==b:
            print("Yes")
            quit()
        a-=1
        z+=1
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int, input().split())
flg = 1
tsuru = X - ((Y - 2*X)/2)
amari = (float(Y) - float(2*X))%2
minus = (Y - 2*X)/2


if(amari > 0):
  flg = 0
elif(tsuru < 0):
  flg = 0
elif(minus < 0):
  flg = 0
else:
  flg = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input().split()
x = int(num[0])
y = int(num[1])
cr = ((4 * x) - y) / 2
tur = (y - (2 * x)) / 2
if cr - int(cr) == 0 and tur - int(tur) == 0 and tur >= 0 and cr >= 0:
    if cr + tur == x and (2 * cr) + (4 * tur) == y:
        print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

# まずは鶴が1匹の時だけを判定,奇数は有えないので排除
for i in range(100):
  for j in range(100):
    if i + j == X and 4*i + 2*j == Y:
      print("Yes")
      sys.exit()

print("No")

Submission status: Accepted

Solution code:
import numpy as np
num_list = []

def leg_num(c, t):
    return 2*c+4*t

for i in range(1, 101):
    leg_num_list = []
    for j in range(i):
        if leg_num(j, i-j) <= 100:
            leg_num_list.append(leg_num(j, i-j))
        if leg_num(i-j, j) <= 100:
            leg_num_list.append(leg_num(i-j, j))
    num_list.append(leg_num_list)

x, y = map(int, input().split(" "))
if y in num_list[x-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if x*2 == y:
  print('Yes')
  exit()

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

kame = (2 * X) - (Y //2)
tsuru = (-1 * X) + (Y //2)

if Y % 2 == 0:
  if kame >= 0 and tsuru >= 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

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 range(len(list1)):
  if list1[i] == X and list2[i] == Y:
    print('Yes')
    sys.exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for T in range(100):
  for K in range(100):
    if (T+K) == X and (2*T) + (4*K) == Y:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
aa =  y - 2 * x
a = aa / 2
print('Yes' if 0 <= a <= x and aa % 2 ==0 else '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 = input().split()
x_y = [int(i) for i in x_y]
x = x_y[0]
y = x_y[1]
# if x[0]*4 < x[i] or x[0]*2 > x[i]:
#     print('No')
s = 0
a = False
while s != x+1:
    if (x-s)*4 + s*2 > y:
        if x == s:
            print('No')
            break
    elif (x-s)*4 + s*2 == y:
        print('Yes')
        break
    elif (x-s)*4 + s*2 < y:
        print('No')
        break
    s+=1

Submission status: Accepted

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

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


if i == X+1:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if Y % 2 == 1:
  print('No')
 
elif Y / 4 > X:
  print('No')
  
elif a >= 0 and b >= 0:
  print('Yes')

else:
  print('No')

Submission status: Accepted

Solution code:
def resolve():
	# X: total animals, Y: total legs
	X, Y = map(int, input().split())
	if Y % 2 != 0: # Y shuldn't odd.
		print('No')
	elif 2*X<=Y<=4*X:
		print('Yes')
	else:
		print('No')
resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

animal = 0
for i in range(x + 1):
    for j in range(x + 1):
        if i + j == x and 2*i + 4*j == y:
            animal += 1
        else:
            animal += 0

if animal >= 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def resolve():
    X, Y = [int(i) for i in input().split()]
    if Y % 2 == 1:
        print("No")
    elif (Y < 2 * X) or (4 * X < Y):
        print("No")
    else:
        print("Yes")

resolve()

Submission status: Accepted

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")
elif foot < N*2:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
import math

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

turu = A[0] * 2
min_leg = A[1] - turu
kame = min_leg / 2
Ans = A[0] - kame

f, i = math.modf(Ans)
if f != 0.0:
    print("No")
    exit()

if Ans < 0 or Ans > A[0]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import numpy as np

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

A = np.array([1, 1, 4, 2]).reshape(2, 2)
v = np.array([X, Y]).reshape(2, 1)

u = np.dot(np.linalg.inv(A),v)

if u[0] < 0 or u[1] < 0:
    print("No")
elif np.linalg.norm(u - (u//1)) > 0.1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

k = 0
t = 0

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


if y % 2 == 1:
    print("No")
else:
    y2 = y / 2
    k = abs(x - y2)
    # print("k=", k)

    n = abs(4 * k - k)
    m = abs(x - y)
    t = abs(n - m)
    # print("n=", n)
    # print("m=", m)
    # print("t=", t)
    if k + t == x:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

kameasi = 4 * N

if M == kameasi:
  print('Yes')
  exit()

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

Submission status: Accepted

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

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

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

is_plus = (a >= 0) and (b >= 0)
is_int = a.is_integer() and b.is_integer()

print(["No", "Yes"][is_plus and is_int])

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

ans = 'No'

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def MS(): return map(str, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
# N = I()
# A = [LI() for _ in range(N)]

import bisect


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

stop = False
ans = 'No'

while not stop:
  for i in range(x+1):
    if y == (x -i) *4 + i * 2:
      ans = 'Yes'
      stop = True
    if i == x:
      stop = True

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
animal,leg = [int(x) for x in input().split()]
import numpy as np
X = np.array([
    [1,1],
    [2,4]
])
Y = np.array([
    [animal],
    [leg]
])
X_inverse = np.linalg.inv(X)
answer = X_inverse.dot(Y)
result = 0
for x in answer:
    for y in x:
        if y<0 or not y.is_integer():
            result = True
            break
if result:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
num, legs = map(int, input().split())
BIRD = 2
TURTLE = 4

if legs % 2:
  print("No")
  exit(0)

bird_lst = [BIRD * n for n in range(num+1)]
turtle_lst = [TURTLE * n for n in range(num+1)]
turtle_lst.sort(reverse=True)

legs_lst = [b + t for b, t in zip(bird_lst, turtle_lst)]

if legs in legs_lst:
  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:
from numba import jit


@jit
def solve(X, Y, Z):
    while X >= 0:
        if 2 * X + 4 * Z == Y:
            return True
        elif 2 * X + 4 * Z < Y:
            X -= 1
            Z += 1
        else:
            return False
    return False


def main():
    X, Y = map(int, input().split())
    Z = 0

    if solve(X, Y, Z):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#%%

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

correct = False

i = 1
j = 1

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

CR=0
TU=0
X,Y=map(int, input().split())
for i in range(0,X+1):
    CR=i
    TU=X-i
    if 2*CR+4*TU==Y:
        print("Yes")
        sys.exit()
    else:
        continue
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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 and r/2 <= n):
        print("Yes")
    else:
        print("No")
else:
    
    print("No")

Submission status: Accepted

Solution code:
import sys

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

for t in range(X + 1):
    for c in range(X + 1):
        if X < t + c:
            break

        if Y == ((t * 4) + (c * 2)) and X == (t + c):
            print("Yes")
            sys.exit()
            
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

a,b=rm()
res=False
for i in range(a+1):
    t=a-i
    if b==i*2+t*4:
        res=True
        break
if res:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
	x,y=map(int,input().split())
	ans=x*4
	if(ans==y):
		print("Yes")
		return
	for i in range(x):
		ans-=2
		if(ans==y):
			print("Yes")
			return

	print("No")


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


y = (leg - 2*anim)  
x = (4*anim - leg)  

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

Submission status: Accepted

Solution code:
#-*- using:utf-8 -*-
 
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())

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

max_y = 4 * X
min_y = 2 * X

if max_y >= Y >= min_y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if cnt>=1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

judge = (4 * x - y) / 2
if judge.is_integer() and judge >= 0 and judge <= x:
    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:
import numpy as np
X, Y=map(int,input().split())

crit=(4*X-Y)/2

ans="No"
if 4*X >= Y and Y%2==0 and Y >= 2*X:
  ans="Yes"

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
X, Y = [int(x) for x in stdin.readline().rstrip().split()]
if Y % 2 == 0:
    Z = Y / X
    if 2 <= Z <= 4:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
import numpy as np

Xin, Yin = input().split()

X = int(Xin)
Y = int(Yin)

a = np.array([[1, 1], [2, 4]])
b = np.array([X, Y])

result = np.linalg.solve(a, b)

if result[0].is_integer() and result[0] >= 0:
    if result[1].is_integer() and result[1] >= 0:
      print('Yes')
    else:
      print('No')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

c = a*2
d = a*4
if d < b:
  print('No')
elif c == b:
    print('Yes')
elif c <= b:
     if (b-c)%2 ==0:
        print('Yes')
     else:
        print('No')
else:
     print('No')

Submission status: Accepted

Solution code:
from math import ceil , floor
x,y=map(int,input().split())
if y<x or y&1:
	print('No')
elif x>=ceil(y/4) and x<=y//2:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    it = map(int, sys.stdin.read().split())
    X, Y = next(it), next(it)

    for a in range(101):
        b = X - a
        if b < 0:
            continue
        if 2*a + 4*b == Y:
            print("Yes")
            return
    print("No")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
animalNum,footNum = map(int,input().split())
kameFoot = 2
turuFoot = 4
totalFoot = 0
ansList = ["Yes","No"]
isYes = False
for i in range(animalNum + 1):
    totalFoot = (kameFoot * i + (turuFoot * (animalNum - i)))
    if(totalFoot == footNum):
        isYes = True
        
if(isYes):
    print(ansList[0])
else:
    print(ansList[1])

Submission status: Accepted

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

for i in range(x):
    val1 = 2 * i + 4 * (x - i)
    val2 = 4 * i + 2 * (x - i)
    if val1 == y:
        ans = "Yes"
        break
    if val2 == y:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

Solution code:

from functools import *
import sys
sys.setrecursionlimit(100000)
import numpy as np

def acinput():
    return list(map(int, input().split(" ")))


X,Y=acinput()


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

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

#y -= 2 or 4
    a = x
    while a >= 0:
        if 2*a+4*(x-a) == y and x-a >= 0:
            return print('Yes')
        a -= 1

    return print('No')


if __name__=='__main__':
    main()

Submission status: Accepted

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

a = 2*x-y/2
b = -x + y/2
#print(a)
#print(b)
if y%2 != 0 or (a < 0 or b < 0) or (a==0 and b ==0 ):
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n_animal, n_foot = map(int, input().split())

checker = False
for i in range(n_animal + 1):
    n_kame = i
    n_tsuru = n_animal - n_kame
    n_foot_pred = n_kame * 4 + n_tsuru * 2
    
    if n_foot == n_foot_pred:
        checker = True
        break
    else:
        continue
if checker:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

# 鶴をp羽とする

p = 0

for p in range(x+1):
  if 2*p + 4*(x-p) - y == 0:
    p=x+5
    break
  else:
    x=x


if p==x+5:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

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

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


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

Submission status: Accepted

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

res = "No"
for i in range(51):
    for j in range(26):
        if (2 * i + 4 * j == y) and (i + j == x):
            res = "Yes"
            
print(res)