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

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

Submission status: Accepted

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

Submission status: Accepted

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

crane=(y//2)-x
tort=x-crane

if y%2==0 and crane>=0 and tort>=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

hontai = int(line[0])
ashi = int(line[1])
flag = "true"

for i in range(hontai+1):
  kame = int(i)
  tsuru = int(hontai-kame)
  if ashi == (4*kame)+(2*tsuru):
    print("Yes")
    flag = "false"
    break

if flag=="true":
  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.is_integer() and a>= 0 and b.is_integer() and b>= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

if int(b) == b and b >= 0 and (x - b) >= 0:
  print ("Yes")
else:
  print ("No")

Submission status: Accepted

Solution code:
x,y = list(map(int,input().split()))
## １頭の条件
if x == 1:
  if (y == 2) or (y == 4):
    print("Yes")
  else:
    print("No")
    
## 51頭以上はそもそもNo    
elif x > 50:
  print("No")
  
##2頭以上の条件
else:   
  check = True
  for i in range(x+1):
    if sum([2]*(i) + [4]*(x-i)) == y:
      print("Yes")
      check=False
      break
  if check:
    print("No")

Submission status: Accepted

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



main()

Submission status: Accepted

Solution code:
def main():
    s = list(map(int,input().split()))
    num_animals, foots = s[0], s[1]
    flag = 0
    for i in range(0, num_animals, 1):
        # 数
        i += 1
        i, j = i, num_animals - i
        # 判定
        if i * 2 + j * 4 == foots:
            flag += 1
            break
        elif i * 4 + j * 2 == foots:
            flag += 1
            break
    if flag == 1:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

a,b =  map(int,input().split())

u=0
for k in range(a+1):
  x = a-k

  if k*2+x*4==b:
    print('Yes')
    u+=1
    break

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

Submission status: Accepted

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

import sys

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
i = list(map(int, input().split()))
X=i[0]
Y=i[1]
flag=0

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(X+1):
    crane_num = x
    turtle_num = X-x
    if 2*crane_num+4*turtle_num==Y:
        flag=True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import statistics
import math
import datetime
from collections import Counter
import itertools

def func(xx, yy):
    pass

def main():
    x, y = map(int, input().split())

    rr = 4 * x

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
 
input_num = stdin.readline().strip().split(" ")

X = int(input_num[0])
Y = int(input_num[1])
if Y % 2 != 0:
  print("No")
else:
  if X * 4 < Y:
    print("No")
  elif X * 2 > Y:
    print("No")
  else:
    print("Yes")

Submission status: Accepted

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

flag = True

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


if flag:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
print('Yes' if not y & 1 and x <= y//2 <= x * 2 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=input()
x,y=n.split()
for c in range(int(x)+1):
  cnt=0
  t=int(x)-c
  asi=2*c+4*t
  if asi==int(y):
    print("Yes")
    cnt=1
    break
if cnt==0:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    import sys
    input = sys.stdin.readline

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

    crane = (4 * x) - y
    turtle = y - (2 * x)

    if crane >= 0 and turtle >= 0 and crane % 2 == 0 and turtle % 2 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    x, y = map(int, input().split())
    if y%2 == 1:
        print('No')
    elif 2*x-y//2 < 0 or  y//2 - x < 0:
        print('No')
    else:
        print('Yes')
        
    


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

# 鶴の総数
for a in range(x + 1):
    b = x - a
    if y == a*2 + b*4:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
from sys import stdin
ans = 'No'
X, Y = [int(_) for _ in stdin.readline().rstrip().split()]
for i in range(X+1):
    if i*2 + (X-i)*4 == Y:
        ans = 'Yes'
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

F = False

for i in range(0,X+1):
  J = X - i
  C = 4 * i + 2 * J
  if C == Y:
    F = True
if F: 
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#X匹Y本の組み合わせが存在するか。b=x-aを2a+4b=yに代入してループ
X,Y = map(int,input().split())
ans = "No"
for a in range(X+1):
  b = X - a
  f = 2 * a + 4 * b
  if f == Y:
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
n, leg = map(int, input().split())
print(['No','Yes'][not leg%2 and 2*n<=leg<=4*n])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if y%2 == 1:
  print('No')
else:
  if 2*x <= y and y <= 4*x:
    print('Yes')
  else:
    print('No')

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print('Yes' if any(x * 2 + i * 2 == y for i in range(x + 1)) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def test(X, Y):
    for a in range(X+1):
        b = X-a
        if a*2+b*4 == Y:
            return 'Yes'
    return 'No'


if __name__ == '__main__':
    X, Y = map(int, input().split())
    print(test(X, Y))

Submission status: Accepted

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

vr_total = 4*a
diff = vr_total - b
turu = diff / 2
kame = a -turu
if turu != int(turu):
  print("No")
  exit()
if turu>=0 and kame>=0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
import numpy
X, Y = map(int, input().split())
if Y % 2 == 1:
    print("No")
    exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    x,y = IL()
    a = np.matrix([
        [1,1],
        [2,4]
    ])
    b = np.matrix([
        [x],
        [y]
    ])
    ans = np.linalg.solve(a,b)
    if np.all(0<=ans) and np.all(abs(ans-np.round(ans)<1e-5)):
        print('Yes')
    else:
        print('No')
    return

if __name__=='__main__':
    Main()

Submission status: Accepted

Solution code:
import sys
import numpy as np
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    x,y = IL()
    a = np.array([
        [1,1],
        [2,4]
    ])
    b = np.array([
        [x],
        [y]
    ])
    try:
        ans = np.linalg.solve(a,b)
    except:
        exit()
    if np.all(0<=ans) and np.all(abs(ans-np.round(ans)<1e-5)):
        print('Yes')
    else:
        print('No')
    return

if __name__=='__main__':
    Main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

x = (4*X-Y)/2
#print(x)

y = (-2*X+Y)/2
#print(y)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
  ## IMPORT MODULE
  #import sys

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    x, y = 3, 8

  else:
    ##INPUT 
    #n = input()
    x, y = map(int, input().split())

  ## SUBMITION CODES HERE
  for i in range(101):
    for j in range(101):
        if (2*i + 4*j == y) and (i + j == x):
          exit(print("Yes"))
  print("No")
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=[int(s) for s in input().split()]
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2*a + 4*b ==Y:
        ans = 'Yes'
print(ans)

Submission status: Accepted

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

for a in range(101):
  b = X - a
  if 2 * a + 4 * b == Y and b >= 0:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

# check
if Y < 2 * X or Y > 4 * X or abs(Y - 2 * X) % 2 != 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a,b = map(int, input().split())
c = 0
if a*4<b:
    print('No')
    sys.exit()
while a!=0:
    if a*2+c*4==b or a*4+c*2==b:
        print('Yes')
        sys.exit()
    a-=1
    c+=1
print('No')

Submission status: Accepted

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

# B - Crane and Turtle
x, y = map(int, input().split())

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

print('No')

Submission status: Accepted

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

else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

max = 4*x
min = 2*x

if y % 2 == 0 and min <= y <= max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
arr = list(map(int, input("").split()))
x=2*arr[0]
y=4*arr[0]

if arr[1]>=x and arr[1]<=y and arr[1]%2==0:
    print("Yes")
else :
    print("No")

Submission status: Accepted

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

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

# if (turu < 0) or (2*x > y):
#    print("No")
#    exit()

# if ((y-turu*2) % 4 == 0):
#    print("Yes")
# else:
#    print("No")

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict
import math

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	x, y = rli()
	# x animals total, y legs total
	# c = num of cranes (2 legs)
	for c in range(x+1):
		t = x - c 
		if 2*c + 4*t == y:
			print("Yes")
			return
	print("No")
	stdout.close()

if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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


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


print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().split()
for i in range(int(s[0])+1):
	if((i * 2 + ((int(s[0])) - i) * 4) == int(s[1])):
		hantei = "OK"
		break
	else:
		hantei = "NG"
if(hantei == "NG"):
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():    
    x, y = map(int, input().split())
    a = 4*x-y
    if not y%2 == 0:
        print('No')
        return
    if a/2 >= 0 and a/2 <= x:
        print('Yes')
    else:
        print('No')

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
A = np.array([[1, 1], [2, 4]])
Ai = np.linalg.inv(A)
B = [int(i) for i in input().split()]
B = np.array(B)
X = Ai.dot(B)
if X[0] >= 0 and X[1] >= 0 and X[0]-int(X[0]) == 0 and X[1]-int(X[1]) == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 y%2 == 1:
  print('No')
  exit()
if 2*x <= y <= 4*x:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x, y =map(int, input().split())  #複数数値入力
result = 0
for i in range(0, x+1):
    leg = i * 2 +(x-i) * 4

    if leg == y:
        result = 1

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

Submission status: Accepted

Solution code:
#from itertools import Combinations
a,b = map(int,input().split())
x = 'No'
for i in range(a+1):
    t = a - i
    if 2 * i + 4 * t == b:
        x = "Yes"
print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in input().strip().split()]
for t in range(0, X+1):
  c = X - t
  if 4 * t + 2 * c == Y:
    print('Yes')
    break
else:
  print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
# 日本語を入力できるようにするために上記一文が必要


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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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


import sys
for i in range(0,51):
    for j in range(0,26):
        if 2*i+4*j==Y and i+j==X:
            print('Yes')
            sys.exit()
else:
    print('No')

Submission status: Accepted

Solution code:
"""
a + b = x
4a + 2b = y

a = (-2x + y) / 2
b = (4x - y) / 2
"""

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

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

Submission status: Accepted

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

for i in range(X+1):
    j = X-i

    if 2 * i + 4 * j == Y: ans = 'Yes'
print(ans)

Submission status: Accepted

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

y = y - x*2

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

Submission status: Accepted

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

x, y = map(int, input().split())
res = "No"

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

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

argv = input().split()

X = int(argv[0])
Y = int(argv[1])
success = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

x,y = inpl()
for i in range(101):
    for j in range(101):
        if i+j == x and 2*i+4*j == y:
            print('Yes')
            quit()
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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