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())
 
kame = 0
turu = x
flag = 0
for i in range(x+1):
  kame = i
  turu = x - i
  if(kame*4 + turu*2 == y):
  	flag = 1

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

Submission status: Accepted

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

def main():
    ans_1 = x * 4 #12
    ans_2 = ans_1 - y #4

    if ans_2 == 0:
        print("Yes")
        return

    elif ans_2 > 0 and ans_2%2 == 0:
        for i in range(0, x):
            ans_2 = ans_2 - 2

            if ans_2 == 0:
                print("Yes")
                return
        print("No")
        return
    else:
        print("No")
        return
main()

Submission status: Accepted

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

count = 2 * x
for i in range(1, x + 1):
    if count < y:
        count += 2

print("Yes" if count == y else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

##xは二匹の合計，yは足の数
##cが鶴，tが亀

c = 0
t = 0

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

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
XY = input().split()
X = int(XY[0])
Y = int(XY[1])
c = (4*X-Y)/2
t = (Y-2*X)/2
if c >= 0 and int(c) == c:
    if t >= 0 and int(t) == t:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
n, sum=list(map(int,input().split(' ')))
lower = n*2
upper = n*4

if (sum % 2 == 0) and (sum >= lower) and (sum <= upper):
  print ("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

if Y % 2 == 1:
  print("No")
else:
  for x in range(S+1):
    y = S - x
    if 4*x + 2*y == Y:
      print("Yes")
      break
  else:
    print("No")

Submission status: Accepted

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

#turu = t
#kame = x - t
turu = 0
kame = 0
flag = 0
for t in range(0, x + 1):
    if t * 2 + (x - t) * 4 == y:
        turu = t
        kame = x - t
        flag = 1

    else:
        pass

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

Submission status: Accepted

Solution code:
number = input()
list = number.split()


def hoge(a, b):
    if a * 4 < b:
        print("No")
        return
    else:
        for i in range(a):
            n = i + 1
            n2 = a - n
            if n * 2 + n2 * 4 == b:
                print("Yes")
                return
        else:
            if a * 4 == b:
                print("Yes")
                return
            print("No")


hoge(int(list[0]), int(list[1]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
a =0
for i in range(n+1):
    for s in range(0, n+1-i)[::-1]:
        if 4*(i) + 2*(n-i) == m:
            a = a + 1
        else:
            a = a
if a > 0:
    print('Yes')
else:
    print("No")

Submission status: Accepted

Solution code:
s = input().split()
intX = int(s[0])
intY = int(s[1])

if (intX > intY / 2) :
    print('No')
    exit()

if ((intY / intX) > 4) :
    print('No')
    exit()

q, mod = divmod(intY, 2)
if (mod == 1) : 
    print('No')
    exit()

intB = (intY-2*intX) / 4
q2, mod2 = divmod(intB, 1)
if (mod == 0) : 
    print('Yes')
    exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
num = [i for i in range(1, x)]
comb = []
for k in num:
    comb.append([k, x - k])
if y % 4 == 0 and y // 4 == x:
    print("Yes")
    exit()
elif y % 2 == 0 and y // 2 == x:
    print("Yes")
    exit()
for j in comb:
    if j[0] * 4 + j[1] * 2 == y:
        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:
total_count, total_legs = map(int, input().split())
isYes = 'false'

for i in range(total_count+1):
  test = 2*i+4*(total_count-i)
  if total_legs == test:
    isYes = 'true'
    print("Yes")

if isYes=='false':
  print("No")

Submission status: Accepted

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

a = int(4 * x - y)

if a % 2 == 0:
    t = a // 2
    if 0 <= t <= x:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
XY_list = list(map(int, input().split()))
X = XY_list[0]
Y = XY_list[1]
k = Y/2 - X
t = 2*X - Y/2
if k%1 == 0 and t%1 == 0 and t >= 0 and k >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
z = 0
res = 'No'
if y % 2 == 0:
    while x >= 0:
        i = x*2 + z*4
        if i == y:
            res = 'Yes'
        x -= 1
        z += 1
print(res)

Submission status: Accepted

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

crain = (4*x-y)/2
tar = -1*(2*x-y)/2

#print(crain)
#print(tar)

if (crain.is_integer() and crain > 0 and crain <= x) or (tar.is_integer() and tar > 0 and tar <= x):
#if (crain.is_integer() and crain > 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

tmp = y - 2 * x

if tmp % 2 != 0:
    ans = "No"
else:
    b = tmp // 2
    a = x - b

    ans = "Yes" if (a >= 0 and b >= 0) else "No"

print(ans)

Submission status: Accepted

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

if X*2>Y or Y>X*4:
  print('No')
elif not Y%2==0:
  print('No')
elif 50 < X:
  print('No')
a = X
b = 0
for i in range(X+1):
  if Y == a*2 + b*4:
    print('Yes')
    break
  else:
    a -= 1
    b += 1

Submission status: Accepted

Solution code:
xy = list(map(int, input().split()))
 
if 4*xy[0]-xy[1]<0 or -2*xy[0]+xy[1]<0:
    print('No')
elif 4*xy[0]-xy[1]==0 and -2*xy[0]+xy[1]==0:
    print('No')
elif (1/2*(4*xy[0]-xy[1]))%1!=0 or (1/2*(-2*xy[0]+xy[1])%1)!=0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

jouken1 = 4 * x - y
jouken2 = y - 2 * x
if ((jouken1 % 2 == 0) and (jouken1 >= 0) and (jouken2 >= 0) and (jouken2 % 2 == 0)):
    print("Yes")
else:
    print("No")
# a+b = X, 2a+ 4b = Y
# a = (4X - Y) /2, b = (Y - 2X)/2

Submission status: Accepted

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

num = target[0]
total = target[1]

for i in range(num + 1):
    tori = i
    kame = (num - i)
    if (tori * 2 + kame * 4) == total:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
h,l=map(int,input().split())
temp=l//2
temp2=abs(temp-h)
temp1=abs(h-temp2)
if ((temp2*4)+(temp1*2))==l:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

crane = [x for x in range(X+1)]
turtle = [x for x in range(X+1)]

ans = "No"
for c in crane:
    for t in turtle:
        if c + t > X:
            break
        if c*2 + t*4 == Y and c+t == X:
            ans = "Yes"
            
print(ans)

Submission status: Accepted

Solution code:
def check2(X,Y):
    for s in range(0,X+1):
        if(4*X-Y==2*s):
            return True
    return False        


if __name__=="__main__":
    a,b = input().split()
    a = int(a)
    b = int(b)
    if(check2(a,b)):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
from sys import stdin
x, y = map(int, stdin.readline().rstrip().split())

res = 'No'

if y%2 == 1: #偶数だけ
    print(res)
elif x*4 == y or x*2 == y:
    print('Yes')

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

    print(res)

Submission status: Accepted

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

for two in range(X + 1):
    four = X - two

    if two * 2 + four * 4 == Y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):
    for i in range(1,X+1):
        j = X-i
        if (2*i+4*j)==Y or (4*i+2*j)==Y:
            print(YES)
            return
    print(NO)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(X, Y)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

bird_only = 2 * X
if bird_only <= Y:
    if (Y%2) == 0:
        r = (Y-bird_only) / 2
        if r <= X:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

wk1 = y - 2 * x
wk2 = 4 * x - y
res = 'Yes'
if wk1 < 0 :
   res = 'No'

if wk2 < 0 :
   res = 'No'

if wk1 % 2 > 0:
   res = 'No'

if wk2 % 2 > 0:
   res = 'No'

print(res)

Submission status: Accepted

Solution code:
import numpy as np


def main(X, Y):
    if 2*X <= Y and 4*X >= Y and Y % 2 == 0:
        return "Yes"
    return "No"


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

Submission status: Accepted

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

Submission status: Accepted

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

if y % 2 != 0:
    print('No')
    exit()
tsuru = ((x * 4) - y) // 2
if tsuru < 0:
    print('No')
else:
    if tsuru <= x:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
xy = [int(x) for x in input().split()]
X = xy[0]
Y = xy[1]
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())


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

Submission status: Accepted

Solution code:
X, Y = [int(n) for n in input().split()]
ans = 'No'
for i in range(X+1):
    for j in range(X+1):
        if i+j == X and 2*i+4*j == Y:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
#8:47
MOD=10**9+7
INT_MAX=10**20+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#################################################################################
x,y=INPUT()
if y>=2*x and y<=4*x and y%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

(x, y) = map(int, sys.stdin.readline().strip().split())

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

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

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

"""
a: 鶴の数、b: 亀の数
a + b = x -> 2a + 2b = 2x
2a + 4b = y

より
2b = -2x + y -> b = -x + 1/2y
"""

Submission status: Accepted

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

for t in range(101):
    for c in range(101):
        if c+t == x and 2*c+4*t ==y:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

if y >= x*2 and y <= x*4 and y % 2 == 0 and x <= 50:
    answer = 'Yes'
else:
    answer = 'No'

print(answer)

Submission status: Accepted

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

T = 0
C = 0

if Y > X * 4:
    print("No")

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]
if (a*2<=b and a*4>=b) and b%2==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

x = (4*N-M)/2
y = (M-2*N)/2


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

Submission status: Accepted

Solution code:
import sys
x = input().split()
for n in range(int(x[0])+1):
    if 4*n <= int(x[1]):
        nihon = int(x[1]) - 4*n
        if nihon == 2*(int(x[0]) - n):
            print('Yes')
            sys.exit()
            
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

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 and turu + kame == x:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if (y % 2 == 0) and ((2 * x <= y) and (y <= 4 * x)):
    print("Yes")
else:
    print("No")
# 偶数かつ2*ｘ<ｙ<4*ｘ

Submission status: Accepted

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

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

ans = 'No'

if k % 2 == 0:
    b = k / 2

    if l % 2 == 0:
        a = l / 2

        if a + b == x and a >= 0 and b >= 0:
            ans = 'Yes'


print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print ("Yes" if Y%2 == 0 and Y/4 <= X <= Y/2 else "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:
a, b = map(int, raw_input().split())
# x + y = a
# 2x + 4y = b
y2 = b - a * 2
x2 = 4 * a - b

if y2 % 2 == x2 % 2 == 0 and y2 >= 0 and x2 >= 0:
    print 'Yes'
else:
    print 'No'

Submission status: Accepted

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

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

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

Submission status: Accepted

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

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x_y = input()
x_y_list = x_y.split()
x = int(x_y_list[0])
y = int(x_y_list[1])
max_y = x * 4
min_y = x * 2
if y % 2 != 0:
  print("No")
elif y > max_y:
  print("No")
elif y < min_y:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#鶴の数 i, カメの数 z
z = 0
#答えに合致するかの判定 ju
ju = 0
for i in range(x+1):
    #print(i)
    z = x - i
    #print(z)
    if i*2 + z*4 == y :
        ju += 1
    else :
        ju += 0

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

Submission status: Accepted

Solution code:
import sys
X,Y = map(int,input().split())
y = Y / 2
if Y % 2 != 0:
    print("No")
    sys.exit()

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

Submission status: Accepted

Solution code:
from numpy.linalg import solve
x,y = map(int,input().split())

left = [[1,1],[2,4]]
right = [x,y]

for val in solve(left,right):
    
    if val < 0 or val % 1 != 0:
        print("No")
        break 
else :print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')


def main():
	x,y=MI()
	ans="No"
	if 4*x-y>=0 and -2*x+y>=0 and (4*x-y)%2==0 and (-2*x+y)%2==0:
		ans="Yes"
	print(ans)

if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

crane_feet = x * 2

if crane_feet == y:
  print('Yes')
  sys.exit()
elif y - crane_feet < 0:
  print('No')
  sys.exit()

diff = y - crane_feet
for i in range(1, diff+1):
  crane_feet -= 2
  if crane_feet < 0:
    break
  
  if crane_feet + i*4 == y:
    print('Yes')
    sys.exit()

print('No')

Submission status: Accepted

Solution code:
[X, Y] = list(map(int, input().split()))
C = 0
T = 0
A = []
for C in range(X+1):
  T = X - C
  if 2*C + 4*T == Y:
    A = [C, T]
  else:
      continue
if bool(A) == True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from sys import stdin

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

Submission status: Accepted

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

Submission status: Accepted

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

cand = []
for i in range(alist[0]+1):
  a = []
  a.append(i)
  a.append(alist[0]-i)
  cand.append(a)

ans = 'No'
for item in cand:
  c = 2 * item[0] + 4 * item[1]
  if c == alist[1]:
    ans = 'Yes'


print(ans)

Submission status: Accepted

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

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

if 2*x == y:
    print("Yes")
    exit()
elif 4*x == y:
    print("Yes")
    exit()

if y % 2 != 0:
    print("No")
    exit()
    
a = 2*x
b = 4*x

if a <= y and b >=y:
    print("Yes")
    exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

a = (Y-2*X)/2
b = (4*X-Y)/2
flag_1 = ((Y - 2*X) % 2 == 0)
flag_2 = ((4*X - Y) % 2 == 0)
flag_3 = ((Y - 2*X) >= 0 and (4*X - Y) >= 0)
flag_4 = not (a == 0 and b == 0)

if (flag_1 and flag_2 and flag_3 and flag_4):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=input().split(' ')
b1=int(a[0])
b2=int(a[1])

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

Submission status: Accepted

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

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

diff = y - x * 2

if diff < 0 or diff // 2 > x:
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
x,y=(int(x) for x in input().split())
ans = y / 2 - x
if 0 <= ans <= x and ans.is_integer() == True:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def iput(): return int(input())
def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))

def solve():
    x, y = mput()
    hoge = (x * 4 - y) / 2
    if hoge % 1 == 0 and x >= hoge >= 0:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
def CraneAndTurtle():

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

    Crane_num = (CraneAndTurtle[1] - 2.*CraneAndTurtle[0])/2.

    Turtle_num = (4.*CraneAndTurtle[0] - CraneAndTurtle[1])/2.

    flag_num_1 = float(float(CraneAndTurtle[1] - 2.*CraneAndTurtle[0])/2.) - int(float(CraneAndTurtle[1] - 2.*CraneAndTurtle[0])/2.)

    flag_num_2 = float(float(4.*CraneAndTurtle[0] - CraneAndTurtle[1])/2.) - int(float(4.*CraneAndTurtle[0] - CraneAndTurtle[1])/2.)

    if (flag_num_1 == 0 or flag_num_2 == 0) and ((0 <= Crane_num and  Crane_num <= CraneAndTurtle[0]) or (0 <= Turtle_num and  Turtle_num <= CraneAndTurtle[0])):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    CraneAndTurtle()

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

print(Ans)

Submission status: Accepted

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

mx = x * 4
mi = x * 2

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

x, y= na()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
ans = 'Yes'
x, y = map(int, input().split())
A = np.matrix([[1, 1], [2, 4]])
Y = np.matrix([[x], [y]])
calc = np.array(np.linalg.solve(A,Y))
for i in calc:
  if i[0] < 0 or i[0].is_integer() is False:
    ans = 'No'
    break
print(ans)

Submission status: Accepted

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

if y%2 == 0:
    a = x + x - y/2
    b = y/2-x
    if a >= 0 and b >= 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
# coding: utf-8

ha = input()
kita = ha.split(" ")
x = int(kita[0])
y = int(kita[1])
ifAshi = False

if(x == 1):
    if(y == 2 or y == 4):
        ifAshi = True
if(x*2 == y):
    ifAshi = True
for i in range(x):
        
    if((y - 2*i)%4 == 0):
        if((x-i) == ((y - 2*i)/4)):
            ifAshi = True

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

Submission status: Accepted

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

kame = X
turu = 0


while kame >= 0:
    if 4*kame + 2*turu == Y:
        print("Yes")
        kame = -2
    kame -= 1
    turu += 1

if kame == -1:
    print("No")

Submission status: Accepted

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

def judge(x_,y_):
    turu = int(2*x_ - (y_/2))
    kame = int((y_/2) - x_)

    if turu < 0 or kame < 0:
        return 'No'

    if (turu + kame == x_ and 2*turu+4*kame == y_):
        return 'Yes'
    return 'No'

print(judge(x,y))