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())
n = 0
t_leg = 2
k_leg = 4

for i in range(101):
    for s in range(101):
        if X - i - s == 0 and Y - 2 * i - 4 * s == 0:
            n += 1

if n > 0:
    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())

cont = 0

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

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

Submission status: Accepted

Solution code:
tmp = input().split(" ")
total = int(tmp[0])
leg = int(tmp[1])
 
if leg % 2 == 0 and 4 * total >= leg >= 2 * total:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for n in range(x+1):
    kame = x - n

    tsuru_leg = n*2
    kame_leg = kame*4

    if y == (tsuru_leg+kame_leg):
        ans = ans + 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
Z = X * 4 - Y

if Z % 2 == 0 and X * 2 >= Z >= 0:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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


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


calc()

Submission status: Accepted

Solution code:
# B Crane and Turtle
X, Y = map(int, input().split())
for i in range(X+1):
    for j in range(X+1):
        if X * 2 <= Y:
            if Y % 2 == 0:
                if (i * 2) + (j * 2) == Y:
                    print('Yes')
                    exit()
print('No')

Submission status: Accepted

Solution code:
def solve(x, y):
    # |x| = |p + q  | = | 1 1 | |p|
    # |y|   |2p + 4q|   | 2 4 | |q|
    # <=>
    # |p| = 1/2 | 4 -1| |x|  =  (4x - y)/2
    # |q|       |-2  1| |y|     (-2x +y)/2
    p2 = 4 * x - y
    q2 = -2 * x + y
    if p2 % 2 == 0 and q2 % 2 == 0 and p2 >= 0 and q2 >= 0:
        return "Yes"
    return "No"


def main(istr, ostr):
    x, y = list(map(int, istr.readline().strip().split()))
    result = solve(x, y)
    print(result, file=ostr)


if __name__ == "__main__":
    import sys

    main(sys.stdin, sys.stdout)

Submission status: Accepted

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

crane = 0
turtle = X

while turtle >= 0:

    allLegs = crane * 2 + turtle * 4
    if allLegs == Y:
        print("Yes")
        exit()

    crane += 1
    turtle -= 1

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())
 
check = True
for i in range(x+1) :
  if (i*2+(x-i)*4) == y :
    print("Yes")
    check = False
    break
  
if check :
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for i in range(100):
    j = X - i
    if j < 0:
        continue
    if 2 * i + 4 * j == Y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

ans = 'No'

for tsuru in range(x+1):
  kame = x - tsuru
  if tsuru * 4 + kame * 2 == y:
    ans='Yes'
  else:
    pass

print(ans)

Submission status: Accepted

Solution code:

N, K = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
# c, t
#2c + 2t = 2X
#2c + 4t = Y

#2t = Y - 2X
#2c = 2X - (Y - 2x)
#   = 4X - Y

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def Ii():return int(sys.stdin.readline())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

x,y = Mi()
if y%2 == 1:
  print('No')
  exit(0)
  
y = y//2

if x <= y <= 2*x:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

n, l = list(map(int, input().split()))

t = (l//2) - n
c = (l//2) - (2*t)

if l % 2 == 1:
    print("No")
elif t < 0 or c < 0:
    print("No")
elif t > n or c > n:
    print("No")
elif t + c != n:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def check(x,y):
  for i in range(100):
    for j in range(100):
        if i+j==x and i*4+j*2==y :
            return "Yes"
  return "No"

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

Submission status: Accepted

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

for i in range(n_all+1):
    leg_kame=2*(n_all-i)
    leg_turu=4*i
    if leg_kame+leg_turu==leg_all:
        print('Yes')
        break
    else:
        continue
else:(print('No'))

Submission status: Accepted

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

Submission status: Accepted

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

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

if (int(t) -t == 0) and (t>=0) and (k>=0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=list(map(int, input().split()))
if x[0]*2<=x[1]<=x[0]*4 and x[1]%2==0:
  print("Yes")
else:
  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:
# -*- coding: utf-8 -*-

def main():

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

    if Y % 2 == 0 and X * 2 <= Y and Y <= X * 4:
        ans = 'Yes'

    else:
        ans = 'No'

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numbers = input().split(" ")
num = int(numbers[0])
foot = int(numbers[1])
if foot % 2 == 0:
  if num * 2 <= foot <= num * 4:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(arr):
    t1 = arr[1]/2 - arr[0];
    t2 = 2*arr[0] - arr[1]/2;
    if arr[1]%2==1 or t1<0 or t2<0:
        return "No"
    return "Yes"
        

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

print(solve(arr))

Submission status: Accepted

Solution code:
X, Y=list(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 y-2*x>=0 and (y-2*x)%2==0 and x-(y-2*x)/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 2*i+4*(x-i) == y:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

result = 'No'
li = []
for i in range(X):
    li.append(4)
if sum(li) == Y:
    result = 'Yes'
else:
    for i in range(X):
        li[i] = 2
        if sum(li) == Y:
            result = 'Yes'
            break

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

is_int = (a.is_integer() and b.is_integer())
is_positive = (a >= 0 and b >= 0)
if is_int and is_positive and (a + b) == X and (2*a + 4*b) == Y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

t = 2
k = 4

flg = "No"
for i in range(x+1):
    if t*i + k*(x-i) == y:
        flg = "Yes"

print(flg)

Submission status: Accepted

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

t = 2
k = 4

flg = False
for i in range(x):
    if t*i + k*(x-i) == y or t*(x-i) + k*i == y:
        flg = True

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

Submission status: Accepted

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

allK = X*4

if (allK - Y) < 0 or (allK - Y)/2 > X or Y%2 == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = list(map(int,input().split()))
maxY = X * 4
deltaY = maxY - Y
answer = "No"
if deltaY % 2 == 0:
    tsuru = deltaY // 2
    if tsuru >= 0 and tsuru <= X:
        answer = "Yes"
print(answer)

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:
import math
def facts(n):
    ans = []
    for  i in range(1, int(math.sqrt(n)+1)):
        if(n%i==0):
            ans.append(i)
            ans.append(n//i)
    ans = sorted(list(dict.fromkeys(ans)))
    if(ans[-1]==n):
        ans = ans[:-1]
    return ans

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

turu = (4*X-Y)/2
kame = (Y-2*X)/2

if turu >= 0 and turu.is_integer() and kame >= 0 and kame.is_integer():
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

def Ss():
  return sys.stdin.readline().rstrip().split(' ')

def Is():
  ss = Ss()
  return map(int, ss) if len(ss) > 1 else int(ss[0])

a, l = Is()

if l % 2 == 0 and 2*a <= l <= 4*a:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
'''
In the name of God
'''

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
flag = False
for i in range(X+1):
    if (i*2) + ((X-i)*4) == Y:
        flag = True
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(j) for j in input().split()]
#template
X,Y = inputlist()
x = (4*X-Y)/2
y = (Y-2*X)/2
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())

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

Submission status: Accepted

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

flag = False
for i in range(x + 1):
  legs = i * 2 + (x - i) * 4
  if legs == y:
    flag = True
    break
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tsuru=x*2
sa=y-tsuru
a=sa/2

if sa%2!=0:
  print('No')
elif a>x:
  print('No')
elif tsuru>y:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

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

result = False

for i in range(X + 1):
    turu = i
    kame = X - i
    if Y == turu * 2 + kame * 4:
        result = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(x+1):
  for j in range(x+1):
    if (i*2 + j*4 )== y and (i + j) == x:
      count +=1

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if ashi%2 == 0 and kame >= 0 and tsuru >= 0:
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
data=input().split()
x=int(data[0])
y=int(data[1])
if y%2 != 0:
    print('No')
else:
    if y-2*x >= 0 and (y-2*x)/2 <=x:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc170_b.py
# https://atcoder.jp/contests/abc170/tasks/abc170_b

# B - Crane and Turtle /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 庭に何匹かの動物がいます。これらはそれぞれ、2本の足を持つ鶴か 4本の足を持つ亀のいずれかです。
# 高橋くんは、「庭の動物の総数は X匹で、それらの足の総数は Y本である」と発言しています。
# この発言が正しいような鶴と亀の数の組合せが存在するか判定してください。

# 制約
#     1≤X≤100
#     1≤Y≤100
#     入力中のすべての値は整数である。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# X Y

# 出力
# 発言が正しいような鶴と亀の数の組合せが存在すれば Yes、なければ No と出力せよ。

# 入力例 1
# 3 8

# 出力例 1
# Yes

# 「庭にいる動物の総数は 3匹で、それらの動物の足の総数は 8 本である」という発言は、
# 鶴が 2 羽、亀が 1匹いる場合に正しいため、発言が正しいような鶴と亀の数の組合せは存在します。

# 入力例 2
# 2 100

# 出力例 2
# No

# この発言が正しいような鶴と亀の数の組合せは存在しません。

# 入力例 3
# 1 2

# 出力例 3
# Yes

# 鶴と亀のうち一方のみが存在する場合も考慮します。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    X, Y = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = 'Yes'
    if Y >= X*2 and Y <= X*4 and Y % 2 == 0:
        result = 'Yes'
    else:
        result = 'No'

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 8']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['2 100']
        lines_export = ['No']
    if pattern == 3:
        lines_input = ['1 2']
        lines_export = ['Yes']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

flag = 0
for t in range(X + 1):
	for f in range(X + 1):
		if (2 * t + 4 * f == Y) and (t + f == X):
			flag = 1

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

Submission status: Accepted

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

f = False
for i in range(X + 1):
    n = 2 * i + 4 * (X - i)
    if n == Y:
        f = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solution():
    user_input = input()
    animals, legs = [int(x) for x in user_input.split()]

    turtles = (4*animals - legs) / 2
    condition = turtles >= 0 and turtles <= animals and turtles % 1 == 0 
    if condition:
        print("Yes")
    else:
        print("No")

solution()

Submission status: Accepted

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

if not ( 1 <= X <= 100 and 1 <= Y <= 100 ): sys.exit()

for I in range(101):
    for J in range(101):
        if (I*2 + J*4) == Y and I+J == X:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
#n = int(input())
x, y = map(int, input().split())
#l = list(map(int, input().split()))
#s = input()
ans = "No"
for i in range(x+1):
    if 2*i+4*(x-i) == y:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

c = 0

for i in range(100):
    for j in range(100):
        if i + j == x and i * 2 + j * 4 == y:
            c = 1
            break
if c:
    print("Yes")
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):
    return [YES, NO][not (2*X <= Y <= 4*X and Y % 2 == 0)]


def main():

    sys.setrecursionlimit(10 ** 6)

    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
    print(solve(X, Y))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):
    return [NO, YES][2*X <= Y <= 4*X and Y % 2 == 0]


def main():

    sys.setrecursionlimit(10 ** 6)

    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
    print(solve(X, Y))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = False
for k in range(X+1):
    t = X - k
    sm = 4 * k + 2 * t
    if sm == Y:
        ans = True


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

Submission status: Accepted

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

kame = 0
tsuru = 0

ans = False
for ki in range(101):
    for ti in range(101):
        if ki + ti != X:
            continue
        sm = 4 * ki + 2 * ti
        if sm == Y:
            ans = True


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

Submission status: Accepted

Solution code:
xlist = list(map(int,input().split()))
x = xlist[0]
y = xlist[1]

if y % 2 == 0:
    bool1 = True
else:
    bool1 = False

if y >= 2 * x and y <= 4 * x:
    bool2 = True
else:
    bool2 = False

if bool1 and bool2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
X,Y=map(int, sys.stdin.readline().split())
for t in range(X+1):
    k=X-t
    if 0<=k:
        if 2*t+4*k==Y:
            print "Yes"
            quit()
else:
    print "No"

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    X, Y = map(int, input().split())

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


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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