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:
#!/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:
        print(YES)
    else:
        b = (2*X-Y)/4
        if b.is_integer and b>=0:
            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())
a=y
a -= 2*x
if a < 0 or a >= 2*x:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
diff = Y - X*2
# 亀 - 鶴
mod = 4 - 2
if diff % 2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b = [int(i) for i in input().split()]
ans='No'
#if b%2==0 and (b%a == 2 or b%a == 4 or b%a==0) and b!=a: ans='Yes'
if (b%a)%2 == 0 and (b/2) <= 4:ans='Yes'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

print(Ans)

Submission status: Wrong Answer

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

def  get_CT(x,y):
  C=(4*x-y)/2
  T=x-C
  if C>=0 and T>=0:
    return 'Yes'
  else:
    return 'No'
  
print(get_CT(X,Y))

Submission status: Wrong Answer

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

cand = []
for i in range(list[0]+1):
  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())
A = (4*X-Y)/2
if  A%1 == 0 and 4*X-Y >= 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:

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



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


if flag:
    print("Yes")
else:
    if X == 1:
        if Y == 2 or Y == 4:
            print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
def func(x):
    for i in range(x[0]+1):
        for j in range(x[0]+1):
            if i+j>x[0]:
                break
            elif i*2 + j*4 == x[1]:
                print('Yes')
                return
    print('No')
    return
func(x)

Submission status: Wrong Answer

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

if x == 1:
    a2 = 2
    a4 = 4
    if a2 == y or a4 == y:
        print('Yes')
        flag = 1
elif x != 1:
    for i in range(0, x-1):
        a2 = 2*(i+1)
        for j  in range(0, x-i):
            a4 = 4*(j)
            y_t = a2+a4
            if y_t == y:
                flag = 1
                print('Yes')
            else:
                pass
        if flag == 1:
            break

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

Submission status: Wrong Answer

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

x=(4*n-m)/2
y=n-x
ans = x+y


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

Submission status: Wrong Answer

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

for i in range(1,101):
    if x - i == 0:
        break
    else:
        for j in range(1,x - i + 1):
            if 2 * i + 4 * j == y:
                print("Yes")
                sys.exit()
print("No")

Submission status: Wrong Answer

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

a = (4 * x - y) // 2
print("Yes" if (0 <= a and a <= 150) else "No")

Submission status: Wrong Answer

Solution code:
i=lambda:map(int,input().split())
x,y=i()
if (x+y)%2==1:
    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 c - int(c) == 0.0 or t - int(t) == 0.0:
        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:
        print(YES)
    else:
        b = (2*X-Y)/2
        if b.is_integer and b>=0:
            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())
a=y
a -= 2*x
if a < 0 or a > 2*x:
    print("No")
else:
    print("Yes")

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    if Y == 4 and X == 1:
        print("Yes")
        return

    while X > 0:
        if 2 * X < Y:
            Y -= 4
            X -= 1
        elif 2 * X == Y:
            print("Yes")
            return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = [int(s) for s in input().split()]
t_num = 0
k_num = 0
flag = False
for i in range(num[0]):
    t_num = i + 1
    k_num = num[0] - t_num
    tmp = t_num * 2 + k_num * 4
    if tmp == num[1]:
        flag = True
if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
number = input()
list = number.split()
if int(list[1]) % 3 == 0 or int(list[0]) * 4 < int(list[1]):
    print("No")
else:
    a = 0
    for i in range(int(list[0])):
        a = i
        n = i + 1
        n2 = int(list[0]) - n
        if n * 2 + n2 * 4 == int(list[1]):
            print("Yes")
            break
    if a == int(list[0]) - 1 and list[0] != "1":
        print("No")

Submission status: Wrong Answer

Solution code:
n,m=(int(x) for x in input().split())
if (4*n-m)%2==0 and 4*n-m>0:
    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 = list(map(int, input().split()))

crain = (4*x - y) / 2
kame = x - crain
if (crain.is_integer() and crain > 0) or (kame > 0):
    print('Yes')
else:
    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")
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:
x,y = map(int,input().split())

def search(count, sum):
    #print(count, sum)
    if sum > y or count > x+1:
        return False
    elif sum == y:
        print("Yes")
        exit()
    else:
        count += 1
        
        #鶴
        sum += 2
        search(count, sum)
        #亀
        sum += 4
        search(count, sum)

search(1, 0)

print("No")

Submission status: Wrong Answer

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 or c + t < 1 or c + t > 100:
            break
        if c*2 + t*4 == Y:
            ans = "Yes"
            
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = [int(x) for x in input().split()]
if (2*X <= Y <= 4*X):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
numbers = [int(i) for i in input().split()]
if (4*numbers[0]-numbers[1])%2 == 0 and (4*numbers[0]-numbers[1]) >= 0 and (numbers[1]-2*numbers[0])%2 == 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 type(b) != int:
            result = 1
            break
if result:
    print("No")
else:
    print("Yes")
# print(ans)

Submission status: Wrong Answer

Solution code:
#2問目
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:
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:
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())

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:
x, y = map(int,input().split())
z = -2
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())
if y>=2*x and y<=4*x:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import math


X,Y=map(int, input().split())
if math.isclose(-Y//2+2*X, round(-Y//2+2*X)) and math.isclose(Y//2-X, round(Y//2-X)):
    if Y//2-X>=0 and -Y//2+2*X>0:
        print("Yes")

    elif Y//2-X>0 and -Y//2+2*X>=0:
         print("Yes")

    else:
         print("No")


else:
    print("No")

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
import sys
if x % 2 == 0 or x % 4 == 0:
  print("Yes")
  sys.exit()
elif x * y % 2 == 0 or x * y % 4 == 0:
  print("Yes")
  sys.exit()
for i in range(x):
  q = x / 2
  if q % 2 == 0:
    print("Yes")
    sys.exit()
print("No")

Submission status: Wrong Answer

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

a = (4*x - y) /2
s = 4*x - y
a = str(a*10)
k = int(a[-1])

if s <= 0:
  print('NO')
elif k == 0:
  print('Yes')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
def NextInts(): return map(int,input().split())

x,y =NextInts()

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

if isinstance(a,int)==True or a>0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


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

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

Submission status: Wrong Answer

Solution code:
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:
X, Y = map(int, input().split())

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:
import sys
X, Y = map(int, input().split())

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

Submission status: Wrong Answer

Solution code:
def main():
    x, y = [int(v) for v in input().split(' ')]
    if y % 2 == 0 and y >= 2 * x and y <= 4 * x:
        print('yes')
    else:
        print('no')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

num_kame = (Y - 2*X)/2
num_tsuru = (4*X - Y)/2

if (num_kame >= 0) and (num_tsuru >= 0) and (num_kame.is_integer()) and (num_tsuru.is_integer()) and (X == num_kame+num_tsuru):
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
for a in range(X+1):
  if 2*a+4*(X-a)==Y:
    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+1-i):
        if i * 2 + j * 4 ==y:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

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


for i in range(101):
    # 足の数
    #f = 2 * i + 4 * (x - i)
    for j in range(101):
        f = 2*i + 4*j
        if f == y:
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
def main():
    sum, leg = map(int, input().split())
    if sum == 1 and 2:
        print('Yes')
        return
    elif sum == 1 and 4:
        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:
def NextInts(): return map(int,input().split())

x,y =NextInts()

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

if isinstance(a,int)==True or a>=0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
xy = input().split()
b = [int(a) for a in xy]

turu = 0
kame = 0

coeff = [[1, 1],[2,4]]
c = 1/(coeff[0][0]*coeff[1][1]-coeff[0][1]*coeff[1][0])


inv_coeff = [[c*coeff[1][1],-c*coeff[0][1]],[-c*coeff[1][0],c*coeff[0][0]]]

turu = b[0]*inv_coeff[0][0]+b[1]*inv_coeff[0][1]
kame = b[0]*inv_coeff[1][0]+b[1]*inv_coeff[1][1]


if turu < 0 or kame < 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
from decimal import Decimal

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

r: Decimal = Decimal(4*x - y)/Decimal(2*x)

s = int(round(2 * r * x + 4 * (1 - r) * x))

c = s == y and 0 <= r <= 1

print("Yes" if c else "No")

Submission status: Wrong Answer

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

a = y // 4
b = y % 4

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



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


if flag:
    print("Yes")
else:
    if X == 1:
        if Y == 2 or Y == 4:
            print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

flag = 0
for i in range(x):
  print(i)
  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())

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

A = np.array([
        [1, 1],
        [2, 4]
    ])
b = np.array([x, y])

inv_A = np.linalg.inv(A)
solve = inv_A @ b
flg = any([solve[0] < 0, solve[1] < 0]) or all([solve[0] == 0, solve[1] == 0])
print("No" if flg else "Yes")

Submission status: Wrong Answer

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 and (y - 2*x) % 2 == 1: 
		return False
	b = (y - 2*x)/2
	a = x - b
	if a < 0: return False
	return True  
print 'Yes' if f(x,y) else 'No'

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 y == a:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
number = input()
list = number.split()
if int(list[1]) % 3 == 0 or int(list[0]) * 4 < int(list[1]):
    print("No")
else:
    a = 0
    for i in range(int(list[0])):
        a = i
        n = i + 1
        n2 = int(list[0]) - n
        if n * 2 + n2 * 4 == int(list[1]):
            print("Yes")
            break
    if a == int(list[0]) - 1:
        print("No")

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

Submission status: Wrong Answer

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

if Y%X ==0 or Y%X ==2 or Y%X ==4:
  if Y//4 <= X:
    print("Yes")
    exit()
  else:
    print("No")
    exit()

print("No")

Submission status: Wrong Answer

Solution code:
wa, num = map(int, input().split())
kame = (num / 2) - wa
turu = wa - kame

if (kame >= 0 and turu >= 0) and (wa == kame + turu) and (num == 2 * turu + 4 * kame):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# B - Crane and Turtle

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

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

#print(a,b)

if a>=0 and b>=0 and a%1==0.5 and b%1!=0.5:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

correct = False

for i in range(1,x):
    for j in range(1,x):
        if i * 4 + ((j - i) * 2) == y:
            correct = True
            break
        else:
            correct = False

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

X = XY[0]
Y = XY[1]

A = np.array([
    [1,1],
    [2,4]
])

b = np.array([X,Y])

x = np.linalg.solve(A,b)

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

Submission status: Wrong Answer

Solution code:
str1 = input()

A = str1.split(" ")

# 存在する動物が全員4本足ならば
all4 = int(A[0])*4
res = "NO"

for i in range(0, int(A[0])+1):
    if all4 == int(A[1]):
        res = "YES"
        break
    else:
        all4 = all4 - 2
        
print(res)

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

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 Y!=0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

a = X*4 - Y 
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:
a,b =map(int,input().split())
c = 1
for i in range(a):
  if (b-2*i)%4==0:
    c = 0
    break
if c ==1:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)

INF = 10**20
def main():
    X,Y = map(int,input().split())

    k = (Y-2*X)//2
    t = X-k

    if k < 0 and t < 0:
        print("No")
    elif k == 0 and t == 0:
        print("No")
    elif (k == 0 and t>0) or (t == 0 and k>0):
        print("Yes")
    else:
        print("Yes" if 0<k and 0<t else "No")



if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
#import sympy
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



#n=int(input())
n,m=list(map(int,input().split()))
a=(m-2*n)/2
b=(4*n-m)/2

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

else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
isOK = False
kame = 0
turu = int(Y/2)
if turu == X:
  isOK = True
for i in range(turu-X):
  if turu != X:
    kame = kame + 1
    turu = turu - 2
  if (turu+kame) == X:
    isOK = True
    break
if isOK == True:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

while x>0:
    x=x-1
    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:
import sys

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

turtles = []
cranes = []

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

for t in range(X + 1):
    for c in range(t, X + 1):
        if Y == (t * 4 + c * 2):
            print("Yes")
            sys.exit()
        else:
            continue

print("No")

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

c = (4*x-y)/2
t = (y-2*x)/2

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

Submission status: Wrong Answer

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


def is_odd(num):
    if num % 2 == 0:
        return False
    else:
        return True


if ans <= 0:
    print('No')
elif is_odd(ans):
    print('No')
elif ans/2 <= x:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A = [int(x) for x in input().split()]

x = A[0]
y = A[1]
check=0
 
for i in range(1,x+1):
  z = i*2+(x-i)*4
  if z==y:
    print("Yes")
    check+=1
if check==0:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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

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

print('No')

Submission status: Wrong Answer

Solution code:
x,y=(map(int,input().split()))
s=(4*x-y)/2.0
if s > 0 and (s*10%10==0) and s <= x:
    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+1):
        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())

A = -(-4*x+y)
B = (-2*x+y)

if (A <= 0 or B <= 0):
  print("No")
  exit()

if ((A + B == 2*x) and (A+2*B == y)):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
flag = 0
for tsuru in range(a, 0):
    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())

fits=y/4
if y%2!=0:
  print('No')
  
if fits==x:
  print("Yes")
  exit()
if fits<=x<=y/2:
  print("Yes")
  exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(X+1):
    for j in range(X+1):
        if i + j <= X:
            if (((2*i) + (3*j)) == Y) or (((2*j) + (3*i)) == Y):
                print("Yes")
                sys.exit()

print("No")