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:
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    X, Y = map(int, input().split())
    for i in range(X + 1):
        for j in range(X + 1):
            if i + j != X:
                continue
            if 2 * i + 4 * j == Y:
                print("Yes")
                return

    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = "No"

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
mini = 2 * x
maxi = 4 * x

if mini <= y <= maxi and y % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
for bird in range(101):
    for turtle in range(101):
        if bird + turtle == x and 2*bird + 4*turtle == y:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
import sys
if y%2 == 1:
    print("No")
    sys.exit()
b = y/2 - x
a = x-b

if a < 0 or b < 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

a = (4*X-Y)/2
b = X - a
d = a.is_integer()
e = b.is_integer()
if a==0 and b==0:
    print('No')
elif a>0 and b>=0:
    if d and e:
        print('Yes')
    else:
        print('No')
elif a>=0 and b>0:
    if d and e:
        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 y == i*2 + (x-i)*4:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

ans = 'No'
for t in range(x+1):
    c = x - t
    if 4*t + 2*c == y:
        ans = 'Yes'

print(ans)

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 and (y - 2*x) >= 0:
  k = (y - 2*x) // 2
  if k <= x:
    print('Yes')
  else:
    print('No')
else:
  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())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# モジュールのインポート
import math


def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    X, Y = list(map(int, input().split()))
    return X, Y


def main(X: int, Y: int) -> None:
    """
    求解処理を行う.

    Args:
        X (int): 庭の動物の総数
        Y (int): 庭の動物の足の総数
    """
    # 求解処理
    ans = "No"
    for crane in range(X + 1):
        turtle = X - crane
        # if math.isclose(2 * crane + 4 * turtle, Y):
        if 2 * crane + 4 * turtle == Y:
            ans = "Yes"
            break

    # 結果出力
    print(ans)


if __name__ == "__main__":
    X, Y = get_input()
    main(X, Y)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# モジュールのインポート
import math


def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    X, Y = list(map(int, input().split()))
    return X, Y


def main(X: int, Y: int) -> None:
    """
    求解処理を行う.

    Args:
        X (int): 庭の動物の総数
        Y (int): 庭の動物の足の総数
    """
    # 求解処理
    ans = "No"
    for crane in range(X + 1):
        turtle = X - crane
        if math.isclose(2 * crane + 4 * turtle, Y):
            ans = "Yes"
            break

    # 結果出力
    print(ans)


if __name__ == "__main__":
    X, Y = get_input()
    main(X, Y)

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())
ans = 'No'
for c in range(x + 1):
    t = x - c
    if 2*c + 4*t == y:
        ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

for x in range(101):
    y = A-x
    if y < 0:
        continue
    if 2*x+4*y == B:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

if y==0:
    print("Yes")
    exit()

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

t = 1/2 * Y - X
c = X - t

float(t).is_integer()
if t >= 0 and float(t).is_integer() and c >= 0 and float(c).is_integer():
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

Submission status: Accepted

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

f = 0

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

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

Submission status: Accepted

Solution code:
import sys
# from collections import deque
# from collections import Counter
# from math import sqrt
# from math import log
# from math import ceil

# def gcd(a, b):
# 	if(a==0):
# 		return b 
# 	return gcd(b%a,a)

# def sieve(n): 
# 	prime=[True for i in range(n+1)]
# 	p=2
# 	while(p*p<=n): 
# 		if (prime[p]==True): 
# 			for i in range(p*p,n+1,p): 
# 				prime[i]=False
# 		p+=1
# 	prime[0]=False
# 	prime[1]=False
# 	s=set()
# 	for i in range(len(prime)):
# 		if(prime[i]):
# 		s.add(i)
# 	return s 

# alpha=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
# mod=10**9+7

fast_reader=sys.stdin.readline
fast_writer=sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i)) for i in argv))
	fast_writer('\n')

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

def sep_input():
	return map(int, input().split())

#_______________________________________________________________________________________________________________________________________

x,y=sep_input()
l=[]
for i in range(x+1):
	l.append(2*i + 4*(x-i))
	l.append(4*i + 2*(x-i))
s=set(l)
if(y in s):
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

Submission status: Accepted

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

    for i in range(x + 1):
        x2 = x - i 
        if 4 * i + 2 * x2 == y:
            ans = 'Yes'
            break

    print(f'{ans}')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x, y = 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(x+1):
    if y == i * 2 + (x - i) * 4:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    y2 = y
    ans = 'No'

    for i in range(x + 1):
        x2 = x - i 
        if 4 * i + 2 * x2 == y:
            ans = 'Yes'
            break

    print(f'{ans}')


if __name__ == '__main__':
    main()

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 * 4 == Y:
    print('Yes')
    exit()

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

print('No')

Submission status: Accepted

Solution code:
# B - Crane and Turtle
def main():
    X, Y = map(int, input().split())
    print("Yes" if any(2 * i + 4 * (X - i) == Y for i in range(X + 1)) else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print('NYoe s'[(2*x<=y<=4*x)>y%2::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    
print(check)

Submission status: Accepted

Solution code:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = 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:
def main():
  X_hiki, Y_hon = map(int, input().split())

  for i in range(X_hiki + 1):
    kame_hiki = i
    tsuru_wa = X_hiki - i
  
    if 4 * kame_hiki + 2 * tsuru_wa == Y_hon:
      print('Yes')
      return

  print('No')
  return


main()

Submission status: Accepted

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

Submission status: Accepted

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

turu = 0
kame = 0
for turu in range(101):
    for kame in range(101):
        if x == (turu + kame):
            if y == (2*turu + 4*kame):
                print("Yes")
                exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def read():
    return list(map(int, input().split()))
x, y = read()
tu = 2 * x
ka, mod = divmod(y - tu, 2)
if 0 <= ka <= x and mod == 0:
    print("Yes")
else:
    print("No", )

Submission status: Accepted

Solution code:
import sys

if __name__ == "__main__":
    for line in sys.stdin:
        anis, legs = map(int, line.split(' '))
        if legs % 2 == 1 or legs > anis * 4 or legs < anis * 2:
            print("No")
        else:
            print("Yes")

Submission status: Accepted

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

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

p = 2 * x

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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*2)) / 4 == x - i : print('Yes');exit()

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

print('No')

Submission status: Accepted

Solution code:
# 鶴亀算
x, y = map(int, input().split())
# 鶴は０匹からx匹いるとして
for a in range(x+1):
    # 亀の個数は全体-鶴a=b　
    b = x - a
    # yがこれに一致したらyesを出力
    if y == a * 2 + b * 4:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print('YNeos'[y%2or y>x*4or y<x*2::2])

Submission status: Accepted

Solution code:
x, y= map(int, input().split())
eq= (y-(2*x))//2
eq2= x-eq
if y%2!=0:
    print('No')
elif eq >= 0 and eq2>= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, leg = map(int,input().split())
crane = (4*n - leg) // 2
turtle = (leg - 2*n) // 2
print('Yes' if abs(crane) + abs(turtle) == n else 'No')

Submission status: Accepted

Solution code:
n, leg = map(int,input().split())
crane = (4*n - leg)//2
turtle = (leg - 2*n)//2
if abs(crane) + abs(turtle) == n:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

print('No')

Submission status: Accepted

Solution code:
X,Y=(int(i) for i in input().split())
a=(4*X-Y)/2.0
b=(Y-2*X)/2.0
if (a>=0)&(b>=0)&(a.is_integer()==True)&(b.is_integer()==True):
     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):
    print ("Yes")
else:
    print ("No")

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

turtle_foreleg = leg - n*2 # all crane ?
if turtle_foreleg < 0:
    print('No')
    exit()

if turtle_foreleg % 2: # odd leg ?
    print('No')
    exit()

turtle = turtle_foreleg//2
crane = n - turtle
if crane < 0:
    print('No')
    exit()

print('Yes')

Submission status: Accepted

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	if len(res)==0:
		res = [n]
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	data = [2]
	#data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	ans = [x for x in data if x!=0]
	#ans = data[:]
	return ans

x,y = readInts()

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 (4 * X - Y) % 2 == 1:
    print("No")
    exit()
 
if (-2 * X + Y) % 2 == 1:
    print("No")
    exit()
 
turu = (4 * X - Y) // 2
kame = (-2 * X + Y) // 2
if turu < 0 or kame < 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

else:
    print("No")

Submission status: Accepted

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	if len(res)==0:
		res = [n]
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	data = [2]
	#data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	ans = [x for x in data if x!=0]
	#ans = data[:]
	return ans

x,y = readInts()

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

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

if turu>=0 and turu<=x:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if Y%2 == 1:
    print('No')
    exit()
else:
    if 2*X <= Y <= 4*X:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(X+1):
    A = (X - i) * 2
    B = i * 4

    if A + B == Y:
        print("Yes")
        sys.exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

print(B())

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:
x,y=map(int,input().split())
for i in range(0,x+1):
    if i*2+(x-i)*4==y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

#a+b=X
#2a+4b+Y
#2a+2b=2X
#a=(4X-Y)/2
#b=(Y-2X)/2

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

# if a>=0 and b>=0 -> Yes, else -> No
if a >= 0 and b >= 0 :
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

#a+b=X
#2a+4b+Y
#2a+2b=2X
#a=(4X-Y)/2
#b=(Y-2X)/2

# if Y-2X=0; b=0; a=X; 2a=Y; print Yes
if Y%2!=0  :
  print("No")
  exit()

#if (Y-2*X) < 0 or (4*X-Y) < 0 or Y%2!=0  :
#  print("No")
#  exit()

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

# if a>=0 and b>=0 -> Yes, else -> No
if a >= 0 and b >= 0 :
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a,l=map(int,input().split())
s=0
if l<a or a==0:
	print("No")
elif l/a==2 or l/a==4:
	print("Yes")

else:
	f=a*4
	if f>l:
		for i in range(a):
			f=f-2
			if f==l:
				print("Yes")
				break			
		else:
			print("No")
	else:
		print("No")

Submission status: Accepted

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

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

#print(X)
#print(Y)
#a+b=X
#2a+4b+Y
#2a+2b=2X
#a=(4X-Y)/2
#b=(Y-2X)/2

# if Y-2X=0; b=0; a=X; 2a=Y; print Yes
if (Y-2*X) == 0  :
  print("Yes")
  exit()

if (Y-2*X) < 0 or (4*X-Y) < 0 or Y%2!=0  :
  print("No")
  exit()



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

# if a>=0 and b>=0 -> Yes, else -> No
if a >= 0 and b >=0 :
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if Y%2 != 0:
  print('No')
  exit()
  
if (Y/2-X >= 0) and (2*X-Y/2 >= 0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	X,Y = inputMap()

	if X == 0 and Y > 0:
		print("No")

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


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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