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: Wrong Answer

Solution code:
X, Y = map(int, input().split()) 
a = "NO"
for i in range(1, X+1):
    if i*2 + (X - i)*4 == Y:
        a = "YES"
        break
    else:
        continue
print(a)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

mx = x * 4
mi = x * 2

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

Submission status: Wrong Answer

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

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

if a + b == X:
  if a>=0 and b>=0:
    print('Yes')
  elif Y == 2*X:
    print('Yes')
  elif Y == 4*X:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

for i in range(50):

    for j in range(25):
        if (i * 2) + (j * 4) == y and (i + j) == x:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

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

s=x*4

if (s-y)%2==0 and s-y>=0:
    T=(s-y)/2
    K=x-T
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a=input().split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
b=0
while b<a[0]:
    if a[1]>=4:
        a[1]=a[1]-4
    if a[1]>=2 and a[1]<4:
        a[1]=a[1]-2
    b=b+1
if a[1]==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

flg = False
for i in range(target[0]):
    tori = i * 2
    kame = (target[0]-i) * 4
    if (tori + kame) == total:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import math
X, Y = map(int,input().split())
ans = "No"
for i in range(math.floor(X//2)+2):
  if(2*X+2*i==Y):
    ans = "Yes"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
T = (Y - 2*X) / 2
K = X - (Y - 2*X) / 2
if (T >= 0) and (K >= 0):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

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

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

if legs in legs_lst:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

if (y % 6 == 2) or (y % 6 == 4) or (y % 6 == 0):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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)):
            f = True
            break;
if f:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def resolve():
	# N: number of Tsuru
	# Y = 2N + 4(X-N) = 4X -2N
	# print 'Yes' if int N exists for given equation or 'No'.
	# X: total animals, Y: total legs
	X, Y = map(int, input().split())
	K = (4 * X) - Y
	if 0 < K < 50:
		print('Yes')
	else:
		print('No')
resolve()

Submission status: Wrong Answer

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

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())#整数値　複数の入力
def S_MAP(): return map(str, input().split())#文字　複数の入力
def LIST(): return list(map(int, input().split()))#整数　複数の入力　配列
def S_LIST(): return list(map(str, input().split()))#文字　複数の入力　配列


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

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
turu = 4
kame = 2
flag = 'No'
for i in range(a+1):
  for j in range(a+1):
    print(turu * i + kame * j)
    if turu * i + kame * j > 4 * a: break
    if b == turu * i + kame * j:
      flag = 'Yes'
  

print(flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

T = 0
C = 0

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

else:
    while True:
        C += 1
        T = X - C
        if Y == (T * 4) + (C * 2):
            print("Yes")
            break
        if X + 1 == C:
            print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
# a + b = x
# 2a + 4b = y
a = 0
b = 0
res = 0.0
det = 2
a = (4 * x - y) / det
b = (-2 * x + y) / det
if a < 0 or b < 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if 4*x >= y:
  a = y/2-x
  b = x-a
  if x == (a+b):
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

if a < 0 or b < 0 or y%2 == 1:
    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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())
    if leg % 2 == 0:
        print('Yes')
        return
    elif leg % 4 == 0:
        print('Yes')
        return
    

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

Submission status: Wrong Answer

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

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

if a + b == X:
  if a>=0 and b>=0:
    print('Yes')
  elif Y == 2:
    print('Yes')
  elif Y == 4:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
ans = 'no'
for a in range(X+1):
    for b in range(X+1):
        if a + b == X and 2*a + 4*b == Y:
            ans = 'yes'
            break
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
i = 0
while i<=a:
  turu = 2*(a-i)
  kame = 4*i
  
  if b == turu:
    print('YES')
    break
    
  if b == kame:
    print('YES')
    break
  
  amari = b - turu
  if amari == 0:
    print('YES')
    break

  if kame !=0:
    if amari % kame == 0:
      print('YES')
      break
      
  i = i + 1
  
else:
  print('No')

Submission status: Wrong Answer

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

crain = (4 * X - Y) / 2

if crain.is_integer() and 0 <= crain:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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):
    a = (4*X-Y)/2
    if a.is_integer and a>=0 and a<=X:
        print(YES)
    else:
        b = (2*X-Y)/4
        if b.is_integer and b>=0 and b<=X:
            print(YES)
        else:
            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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# 別変数の整数複数個
X, Y = [int(x) for x in input().strip().split(" ")]

if Y % 2 == 1:
    print("No")
else:
    turtles = (Y - 2 * X) // 2
    cranes = (4 * X - Y) // 2
    print(cranes, turtles)
    if (0 <= turtles <= X) and (0 <= cranes <= X):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

max = X * 4

if Y > max:
    print('No')
elif Y % 2 != 0:
    print('No')
else:
    for i in range(2*X, 4*X+1, 2):
        print(i)
        if i == Y:
            print('Yes')
            break
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
flag = 0
for tsuru in range(a, 0, -1):
    if 2*tsuru + 4*(a-tsuru) == b:
        flag = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# Crane and Turtle
def combi(x , y):
    lower = x * 2
    higher = x * 4
    if y in range(lower, higher + 1):
        return "YES"
    return "NO"

inp = list(map(int, input().rstrip().split()))
print(combi(inp[0], inp[1]))

Submission status: Wrong Answer

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

turtles = x
crane = (turtles*4 - y)//2

if isinstance(crane, float) or crane < 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
lst = [1, 2]
def solve (arr):
  if arr[0] > arr[1]:
    print("no")
    for i in range(50):
      if (2*i)*arr[0] == arr[1]:
        if (4*i)*arr[0] == arr[1]:
          print("yes")
print(solve(lst))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 亀は4本の足を持ち，鶴は2本の足を持つ．
kame = 4
turu = 2

# まずは鶴が1匹の時だけを判定,奇数は有えないので排除
if Y == 2:
  print("Yes")
elif Y == 100:
  print("No")
elif Y % turu !=0:
  print("No")
elif X*kame < Y:
  print("No")
else:
  ans = Y
  while True:
    Y = Y % 2
    ans = ans/2
    if Y != 0:
      print("No")
      break
    elif Y == 0 and ans == 0:
      print("Yes")
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

for c in crane:
    for t in turtle:
        if c + t > X:
            break
        if c*2 + t*4 == Y:
            print("Yes")
            sys.exit(0)
            
print("No")

Submission status: Wrong Answer

Solution code:
x ,y = map(int, input().split())
 
sun = 0
flag = True
for i in range(0, x+1):
    sum = i*2
    if sum == y:
        print('Yes')
        flag = False
        break
    for j in range(0, x+1):
        if i+j >x:
            break
        sum += j*4
        if sum == y:
            print('Yes')
            flag = False
            break
if flag:
    print('No')

Submission status: Wrong Answer

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

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

if kame<=x:
    if (y-(kame*4))//2==x-kame:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

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

d = a.is_integer()
e = b.is_integer()
print(d)
print(e)
if a==0 and b==0:
    print('No')
elif a>=0 and b>=0:
    if d and e:
        print('yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
animal,leg = [int(x) for x in input().split()]
# crane + turtle = animal
# 2*crane + 4*turtle = leg
import numpy as np
A = np.array([
    [1,1],
    [2,4]
])
B = np.array([
    [animal],
    [leg]
])
A_inv = np.linalg.inv(A)
ans = A_inv.dot(B)
print(ans)
result = 0
for a in ans:
    for b in a:
        if b<0 or not b.is_integer():
            result = 1
            break
if result:
    print("No")
else:
    print("Yes")
# print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- Coding: utf-8 -*-

x, y = (int(x) for x in input().split())

c = 4 * x - y
t = y - 2 * x

if c % 2 == 0 and t % 2 == 0:
    if c < 0 or t < 0:
        print("No")
    else:
        print("Yes")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

kame = [i for i in range(x+1)]
tsuru = [i for i in range(x+1)]

for k, t in itertools.product(kame, tsuru):
    if 4*k + 2*t == y:
        print('Yes')
        sys.exit()

print('No')

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
line = input()
line = line.rstrip().split(' ')

total = int(line[0])
total_leg = int(line[1])

kame = (total_leg - total * 2) / 2
tsuru = total - kame

print(tsuru, kame)

if total_leg % 2 == 1:
    print('No')
elif (0 <= kame and kame <= total) and (0 <= tsuru and tsuru <= total):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

x, y = map(int, input().split())
left = [[1, 1],
        [2, 4]]

right = [x, y]

a = solve(left, right)

left = [[1, 1],
        [4, 2]]

right = [x, y]
b = solve(left, right)
if (a[0] > 0 and a[1] >0) or (b[0] > 0 and b[1] >0):
    if (a[0].is_integer() is True and a[1].is_integer() is True) or (b[0].is_integer() is True and b[1].is_integer() is True):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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):
    a = (4*X-Y)/2
    if a.is_integer and a>=0 and a<=Y:
        print(YES)
    else:
        b = (2*X-Y)/4
        if b.is_integer and b>=0 and b<=Y:
            print(YES)
        else:
            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: Wrong Answer

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

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

if a + b == X:
  if a>=0 and b>=0:
    print('Yes')
  elif Y == 2:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI():return list(map(int,sys.stdin.readline().rstrip().split()))
def LS():return list(sys.stdin.readline().rstrip().split())

def main():
  X,Y = LI()[:]
  #print(X,Y)

  if ((Y-2*X) % 2) == 0:
    a = (Y-2*X) / 2
    if a<=X:
      print('Yes')
      exit()
  
  print('No')

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
X,Y=input().split();
X=int(X);
Y=int(Y);
for k in range(X):
  if Y==4*k+2*(X-k):
    print("Yes");
    exit();
print("No");

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if ((c >= 0 and t >= 1) or (c >= 1 and t >= 0)):
    if y % 2 == 0:
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

tmp = (Y-2*X) / 2

if tmp < 0 or (X-tmp) < 0 or tmp*4+(X-tmp)*2 != Y:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

kame = ((4 * X) - Y) // 2
amari = ((4 * X)) % 2
tsuru = X - kame

if amari > 0:
  print("No")
elif kame >= 0 and tsuru >= 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

crain = (4 * N - M) / 2
if crain.is_integer() and crain > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x,y=(int(x) for x in input().split())
if y>x*6:
    print('No')
elif y<x*2:
    print('No')
elif y%2==1:
    print('No')
elif y==4 and x==1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

while x>0:
    if y>=4:
        y=y-4
        
    elif y>=2:
        y=y-2
    
    x=x-1

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

Submission status: Wrong Answer

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

for i in range(0,x):
    if x*4-i*2==y:
        z=1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def check():
    for i in range(0, Y+1):
        if i * 2 + (X - i) * 4 == Y:
            return 'Yes'
    return 'No'

print(check())

Submission status: Wrong Answer

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

a=b=0


if x*4<y or x*2>y:
    print('No')
    exit()

if (y-2*x)%2==0:
    n=(y-2*x)/2
    if x-b>=0:

        print('鶴',x-b)
        print('亀',n)

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

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
i = 0
while i<=a:
  turu = 2*(a-i)
  kame = 4*i
  amari = b - turu
  
  if b == turu:
    print('YES')
    
  if b == kame:
    print('YES')
  
  
  if amari == 0:
    print('YES')
    break

  if kame!=0:
    if amari % kame == 0:
      print('YES')
      break
      
  i = i + 1
  
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def check(X,Y):
    for s in range(1,Y+1):
        for t in range(1,Y+1):
            if(s+t==X and 2*s+4*t==Y):
                return True
    return False

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

Submission status: Wrong Answer

Solution code:
import numpy as np
x, y = map(int, input().split())
ans = -1

a = np.array([[2, 4], [1, 1]])
b = np.array([y, x])
c, d = np.linalg.solve(a, b)


if c + d == x and c >= 0 and d >= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

def check(x, y):
    # 動物の可能性を考える
    for i in range(0, x):
        # 2本足,4本足の動物の数
        leg2_animal = i+1
        leg4_animal = x - leg2_animal
        
        # 全体の足の数を数えてみる
        sum_legs = leg2_animal * 2 + leg4_animal * 4

        if sum_legs == y:
            print("Yes")
            return

    print("No")

check(x,y)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

#つるをi

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
turu = 4
kame = 2
flag = 'No'
for i in range(a+1):
  for j in range(a-i+1):
    print(turu * i + kame * j)
    if b == turu * i + kame * j:
      flag = 'Yes'
  

print(flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

a = y // 4
b = y % 4

c = b // 2
d = b % 2

if a <= x and c <= x and d == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x,y  = map(int,input().split())
hon = 0
flag = False
for i in range(1,x+1):
    turu = i
    kame = x - i

    hon=2*turu+4*kame
    if hon == y:
        flag = True
        
for i in range(1,x+1):
    print(i)
    turu = x-i
    kame = i 

    hon=2*turu+4*kame
    if hon == y:
        flag = True
    
if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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):
  if 2*x>y:
    break
  if 2*i+4*(x-i)==y:
    print('Yes')
    sys.exit()
 
print('No')

Submission status: Wrong Answer

Solution code:

def main():
    X, Y = map(int, input().split())
    #total X
    #feet Y
    for x in range(X+1):
        y = X - x
        feet = 4 * x + 2 * y
        if feet == Y:
            print("YES")
            return

    print("NO")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X,Y = map(int, input().split())
answer = []
for i in range(X):
    answer.append(i * 4 + (X - i) * 2)
if Y in answer:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if (Y%2 == 1):
  print("No")
elif (Y > (X*4)):
  print("No")
else:
  yes = False
  for i in range(1,X+1):
    fNum = i
    tNum = X-i
    if ((fNum*4)+(tNum*2)==Y):
      print("Yes")
      yes = True
  if not (yes):
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


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

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

Submission status: Wrong Answer

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

res = 'No'
if y%2 == 1: #偶数だけ
    print(res)
else:
    for i in range(0, x):
        if i*4 + (x-i)*2 == y:
            res = 'Yes'

    print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
A = X
B = 0
if Y % 2 != 0:
  print("NO")
else:
  while A >= 0:
    C = A*2 + B*4
    if C == Y:
      print("YES")
      A-=1
      B+=1
  print("NO")