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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
a = float(2*X-0.5*Y)
b = float(-X+0.5*Y)

if (a*b>=0) and (a.is_integer()) and (b.is_integer()):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    X,Y = map(int,input().split())
    for i in range(101):
        for j in range(101):
            if i + j ==X and i*2+j*4 == Y:
                print("Yes")
                exit()
    print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
leg = [2]*X
Y -= 2*X

if Y > 0:
    for i in range(X):
        leg[i] += 2
        Y -= 2
        if Y <= 0:
            break

if Y == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

B = (Y / 2) - X
A = X - B

if(not B.is_integer()):
    print("No")
    exit()
if(B < 0):
    print("No")
    exit()
if(A < 0):
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
def crane_and_turtle():
    condition = input()
    num_str = condition.split()
    X = int(num_str[0])
    Y = int(num_str[1])
    
    a = 0
    b = X
    
    for i in range(X+1):
        if 2*a + 4*b == Y:
            print('Yes')
            return
        a += 1
        b -= 1
    
    print('No')
    return

crane_and_turtle()

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
#a,bをかめとつるの数とする、これはそんなに量多くないので行ける
for a in range(X+2):
    if a==X+1:
        print("No")
    elif (Y-4*a)%2==0 and int((Y-4*a)/2)==X-a:
        print("Yes")
        break
    else:
        continue

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y % 2 ==1:
    print("No")
elif y//2-x>=0 and 2*x-y//2>=0:
    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 == 2 * i + 4 * (x -i):
    print('Yes')
    exit()
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

for t in range(51):
    if Y - t*2 -(X-t)*4 == 0:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

Solution code:
input1 = list(map(int, input().split()))
X = input1[0]
Y = input1[1]

judge = False
if ((4*X - Y) % 2 == 0 and (4*X - Y) >= 0 and Y >= 2 * X):
    judge = True

print("Yes" if judge == True else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if (y / x == 2 or y / x== 4):
    print('Yes')
    sys.exit()

b = (y - 2 * x) * 1.0 / 2
a = x - b
if b.is_integer() and 0 < b and 0 < a:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a=input().split(" ")
ans=0
x=0
for i in range(1,int(a[0])):
	for j in range(1,int(a[0])):
		ans=(i*2)+(j*4)
		if ans==int(a[1]) and i+j==int(a[0]):
			x=x+1
if int(a[0])*4==int(a[1]):
	x=x+1
if int(a[0])*2==int(a[1]):
	x=x+1
if x>=1:
	print("Yes")
elif x==0:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
from itertools import combinations_with_replacement

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

for x in combinations_with_replacement('24', X):
    a = np.array(list(map(int, x)))
    if a.sum() == Y:
        flag = 1
        break
if flag == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

kame = (y-2*x)/2
tsuru = x - kame

if all(list(map(float.is_integer, [tsuru, kame])) + list(map(lambda x: x>=0, [tsuru, kame]))):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

            if a==y:
                s+=1
else:pass

if s>=1:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
x,y=map(int,input().split())
if x*4>=y and y>=2*x and (x*4-y)%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

b = y/2 - x
a = x - b

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

Submission status: Accepted

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

a = 2 * x - y / 2
b = y / 2 - x

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

hoge = 4 * X - Y
result = 'No'

if hoge % 2 == 0:
    if hoge >= 0:
        if hoge // 2 <= X:
            result = 'Yes'

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
ans = 'No'
B = (Y-2*X)/2
if B.is_integer():
  if B >=0:
    if B <=X:
      ans ='Yes'
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    a,b = cin()
    if b>=2*a and b<=4*a and not b&1:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

x, y = map(int, readline().split())
for i in range(51):
    for j in range(26):
        if i * 2 + j * 4 == y:
            if i + j == x:
                print('Yes')
                exit()
print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
K = Y / 2 - X#48
T = 2 * X - Y / 2 #

if K.is_integer() and K>=0 and T.is_integer() and T>=0 and K * 4 + T * 2 == Y and K + T == X:
    print("Yes")
else:
    print('No')

Submission status: Accepted

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

if Y%2 != 0:
    print("No")
else:
    flag = False
    for x in range(1, X+1):
        leg1 = x*2 + (X-x)*4
        leg2 = x*4 + (X-x)*2
        if leg1 == Y or leg2 == Y:
            flag = True
            break
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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


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

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

a = x-b
2b = y  - 2x
"""
def f(x,y):
  	
	if (y - 2*x) < 0: return False
	b = (y - 2*x)/2
	a = x - b

	b = (y - 2*x)/2
	a = x - b
	
	if a < 0: return False


	return a+b == x and 2*a + 4*b ==y
  
print 'Yes' if f(x,y) else 'No'

Submission status: Accepted

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

Submission status: Accepted

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

flg = 0
for i in range(x + 1):
    a = 2 * i + 4 * (x - i)
    if a == y:
        flg = 1

if flg == 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:

x,y = list(map(int, input().split()))
tmp = y%2
count = 0
"""
while tmp == 0:
    y /= 2
    tmp = y%2
#    print(y)
    count += 1
print(count)
if y ==1 and count >= x:
    print("Yes")
else:
    print("No")
"""

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  X, Y = map(int, input().split())
  tsuru = 0
  while tsuru <= X:
    kame = X - tsuru
    if (tsuru * 2 + kame * 4 == Y):
      print('Yes')
      return
    tsuru +=1
    
  print('No')
    
main()

Submission status: Accepted

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

# 標準入力の取得
X, Y = list(map(int, input().split()))

# 求解処理
result = False
for crane in range(X+1):
    turtle = X - crane
    if math.isclose(2*crane + 4*turtle, Y):
        result = True
        break

# 結果出力
if result:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
b2 = y-2*x
if b2 % 2 == 0 and b2 >= 0:
    a = x - (b2//2)
    if a >= 0:
        print('Yes')
    else:
        print('No')
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*x)%2)==0):
    if(((y-2*x)//2)>=0):
        if(((y-2*x)//2)<=x):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

X, Y = [int(s) for s in input().split()]

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

low = Y // 4 + (Y % 4 != 0)
high = Y // 2

if low <= X <= high:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x, y = map(int, 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())

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

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
for t in range(101):
    for k in range(101):
        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())
c=1

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

if c==1:
  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")
        break
    else:
        if i == X :
            print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = 0

for x in range(0,X+1):
    if 4 * X - 2 * x == Y:
        flag = 1
        break

if X == 1 and Y == 2:
    flag = 1
if X == 1 and Y == 4:
    flag = 1

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

Submission status: Accepted

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

if 2 > leg / all or leg / all > 4 or leg % 2 == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
import sys

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

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

print("No")

Submission status: Accepted

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

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

if y < 2*x:
    print('No')
elif y % 2 != 0:
    print('No')
else:
    for i in range(x+1):
        if i*2 + (x-i)*4 == y:
            print('Yes')
            break
        elif i == x:
            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 = list(map(int, input().split()))
if Y % 2 == 1:
    print('No')
elif X * 4 >= Y:
    if X * 2 <= Y:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

a=y//2

while a>=0:
  if x-a<0:
    a-=1
    continue
  if 2*a+4*(x-a)==y:
    print('Yes')
    exit(0)
  a-=1
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

if Y%2==1:
  print('No')
elif 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(0, x+1):

    ashi = 2*i+4*(x - i)
    if ashi == y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x, y = map(int, input().split())

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

if a<0 or b<0:
    print('No')
else:
    if (a-int(a)) != 0 or (b-int(b)) != 0:
        print('No')
    else:
        print('Yes')

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 and i+j == X:
      print('Yes')
      sys.exit()
    elif i == X and j == X:
        print('No')

Submission status: Accepted

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

# 全部亀でもならない合計足数に足りない
if y > x * 4:
    print('No')
# 全部鶴でも合計足数をはみ出す
elif y < x * 2:
    print('No')
# 足が奇数
elif y % 2 == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


X, Y = MI()
for i in range(101):
    for j in range(101):
        if i + j == X and 2 * i + 4 * j == Y:
            print('Yes')
            exit()
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 = list(map(int, input().split(" ")))
ans = "No"

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

	print('No')
	return

if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

Submission status: Accepted

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

rslt = 'No'

for c in range(X+1):
  if 2*(2*X - c) == Y:
    rslt = 'Yes'
    break

print(rslt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

XY = np.asarray( list(map(int, input().split())) )

Ainv = np.asarray([[2, -0.5], [-1, 0.5]])

x, y = Ainv.dot(XY)

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

Submission status: Accepted

Solution code:
L = [int(i) for i in input().split()]
flag=0
for i in range(L[0]+1):
    # print(L[1]-i*2-(L[0]-i)*4)
    if L[1]-i*2-(L[0]-i)*4==0:
        print("Yes")
        flag=1
        break
    # if L[1]<i*2+(L[0]-i)*4:
    #     print("df")
    #     break

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
#n = int(input())
x, y = map(int, sys.stdin.readline().split())
#s = input()
#x = list(map(int, sys.stdin.readline().split()))
     

if 2 * x > y:
    print("No")
    sys.exit()

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

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

Submission status: Accepted

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

a = 0
B = Y//4
flag = 0
for b in range(B,-1,-1):
    a = X-b
    ans = a * 2 + b * 4
    if ans == Y and (a+b) == X and a>=0:
        flag = 1
        print('Yes')
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for a in range(x+1):
    b = x - a
    if 2 * a + 4 * b == y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
heads,legs = map(int,input().split())

if legs%2 != 0:print("No")
elif legs >= heads*2 and legs <= heads*4:print("Yes")
else:print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
frag = False
for t in range (100):
    for k in range (100):        
        if(2*t + 4*k == y and t +k == x):
            frag=True
            break
if(frag==True):print("Yes")
else:print("No")

Submission status: Accepted

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

else:
    a = 2*x - y/2
    b = 2/y - x
    if 0<=a and  a<=x:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

    return 'No'



print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

a = np.array([[2, 4], [1, 1]])
b = np.array([y, x])
ans = np.linalg.solve(a, b)
if ans[0] >= 0 and ans[0].is_integer() == True and ans[1] >= 0 and ans[1].is_integer() == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for x in range(300):
    for y in range(300):
        if x+y==X and 2*x+4*y==Y:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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


for i in range(a+1):
    if 4*i+2*(a-i)==b:
        print('Yes')
        break;
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for t in range(X + 1):
    k = X - t
    y = t * 2 + k * 4
    if Y == y:
        print('Yes')
        flag = 1

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

Submission status: Accepted

Solution code:
a,v = map(int,input().split())
f = 0

for i in range(a+1):
    ans = i*2 + (a-i)*4
    if v == ans:
        f= 1
    
if f ==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:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
list= input().split(" ")
X=int(list[0])
Y=int(list[1])

for w in range(X+1):
    z = X-w#crane_num
    w_leg_num = int(w)*2#turtle_leg_num
    z_leg_num = int(z)*4
    total_leg_num =w_leg_num+z_leg_num
    if total_leg_num == Y:
        print("Yes")
        break
    elif w==X:
        print("No")

Submission status: Accepted

Solution code:
i=(input().split())
x=int(i[0])
y=int(i[1])

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

if a.is_integer() and b.is_integer() and a>=0 and b>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

t = y /2 - x
k = 2 * x - y / 2
#print(t, k)
if (t // 1 == t) and (k >= 0) and (t >= 0):
    print('Yes')
else:
    print("No")

Submission status: Accepted

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


l=list(range(2*X,4*X+2,2))
#print(l)

flag=False
for i in range(len(l)):
    if l[i]==int(Y):
        flag=True

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

Submission status: Accepted

Solution code:
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()
X, Y = map(int,input().split())

c = 2
t = 4
ans ='No'

for i in range(0,X+1):
  if i *c + (X-i)*t == Y:
    ans= 'Yes'
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

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

Submission status: Accepted

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

Submission status: Accepted

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


for i in range(0,100+1):
    
    for j in range(0,100+1):
        if i + j > X:
            break
        if (i*2 + j*4) == Y and (i+j) == X:
            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*x)%2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

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

yn=""
for xi in range(0,x+1):
    if (x-xi)*4+xi*2==y:
        print("Yes")
        yn="Yes"
        break

if yn=="":        
    print("No")

Submission status: Accepted

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

a = (y-2*x)/2
b = (4*x-y)/2
if a % 1 == 0.0 and b % 1 == 0.0 and a>=0 and b>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = [int(tmp) for tmp in input().split()]
a = a*2
y = (b-a)//2
x = (a-2*y)//2
if x<0 or y<0 or b%2==1 :
	print("No")
else :
	print("Yes")

Submission status: Accepted

Solution code:
data = input().split()

legs = int(data[1])
animals = int(data[0])
flag = 0

if int(data[1]) % 2 == 1:
  flag = 0
elif int(data[0]) * 4 < legs:
  flag = 0
else:
  ans = animals * 2
  if ans == legs:
      flag = 1
  else:
    for i in range(animals):
      ans += 2
      if ans == legs:
        flag = 1
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    X, Y = [int(x) for x in input().split()]
    for x in range(X + 1):
        if (x * 2 + (X - x) * 4) == Y:
            return "Yes"
    return "No"


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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