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())
a=0
while not(a==X+1):
  b=X-a
  if (Y==2*a+4*b):
    print("Yes")
    exit()
  
  
  a+=1
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
count = 0
for c in range(x + 1):
    for t in range(x + 1):
        if c + t == x and c * 4 + t * 2 == y:
            count += 1

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

Submission status: Accepted

Solution code:
a=[int(i) for i in input().split()]
H=0
while (a[0] >= 0):
    if a[1] == 2*a[0]:
        print("Yes")
        H=1
        break
    a[1]-=4
    a[0]-=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input().split()
X = int(N[0])
Y = int(N[1])
Z = Y - 2 * X
if Y % 2 == 0:
    if 0 <= Z / 2 <= X:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

i=0
while i<=x:
    leg=i*4+(x-i)*2

    if(leg==y):
        print('Yes')
        break
    i+=1

if i>x:
    print('No')

Submission status: Accepted

Solution code:
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:
N, M = map(int,input().split())
for i in range(0, N+1):
    f = 2 * i + 4 * (N - i)
    if f == M:
        print("Yes")
        break
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def S():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


x, y = MI()

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

print("No")

Submission status: Accepted

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

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


def check(x, y):
    k = y - 2 * x
    if k % 2 != 0 or k < 0:
        return 'No'

    k /= 2
    if x - k < 0:
        return 'No'

    return 'Yes'


ans = check(X, Y)
print(ans)

Submission status: Accepted

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

f = False
for num_of_tsuru in range(0, x+1):
    num_of_kame = x - num_of_tsuru
    if (2*num_of_tsuru) + (4*num_of_kame) == y:
        f = True
        break

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

Submission status: Accepted

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

a_div = ((4*X-Y)/2)
a_mod = ((4*X-Y)%2)
b_div = ((Y-2*X)/2)
b_mod = ((Y-2*X)%2)

"""
print(a_div)
print(b_div)
print(a_mod)
print(b_mod)
"""

if( (a_div >= 0 and a_mod == 0) and (b_div >= 0 and b_mod == 0)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp = list(map(int, input().split()))
X = temp[0]
Y = temp[1]
ansT = 2*X - Y/2
ansK = Y/2 - X
if Y / X in(2, 4):
  print("Yes")
elif int(ansT) == ansT and int(ansK) == ansK and ansT > 0 and ansK > 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

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

for c in range(101):
  if 2*c + 4*(x-c) == y and x - c >= 0:
    print('Yes')
    sys.exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

policy1 = (tsuru.is_integer() and tsuru > 0) and (
    kame.is_integer() and kame > 0)
polocy2 = (tsuru.is_integer() and tsuru > 0) and (
    kame.is_integer() and kame == 0)
polocy3 = (tsuru.is_integer() and tsuru == 0) and (
    kame.is_integer() and kame > 0)


if policy1 or polocy2 or polocy3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

t = 2*X-Y/2
k = -X+Y/2

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

Submission status: Accepted

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


def main():
    # 整数の入力
    x, y = map(int, input().split())

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

def count_legs():
    X, Y = map(int, input().split())
    for i in range(X):
        if i * 2 + (X-i) * 4 == Y or (X-i) * 2 + i * 4 == Y:
            print('Yes')
            return True
    print('No')

if __name__ == "__main__":
    count_legs()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#デフォルト
import itertools
from collections import defaultdict
import collections
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

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

flag = False
for i in range(x + 1):
    for j in range((x + 1) - i):
        if (i * 2 + j * 4) == y and i+j== x:
            flag = True

if flag == False:
    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 + 2 * (x - i) == y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
# coding:utf-8


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

    m = (Y-2*X)

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

    return


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
count, total = map(int, input().split())
turtle = 4
clain = 2

def assert_pattern(count, total):
    if turtle * count < total:
        return False
    if clain * count > total:
        return False
    if total % clain != 0:
        return False
    return True
    

print('Yes' if assert_pattern(count, total) else 'No')

Submission status: Accepted

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

for i in range(0, A+1):
    f = 2 * i + 4 * (A - i)
    if f == B:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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


def xy(a):
    if a * 2 + (x - a) * 4 == y:
        print("Yes")
        exit()


for i in range(int(x + 1)):
    xy(i)

print("No")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    X, Y = MI()

    sm = X * 4
    while X >= 0:
        if sm == Y:
            print('Yes')
            return
        sm -= 2
        X -= 1
    print('No')

if __name__ == '__main__':
    solve()

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:
n = list(map(int, input().split()))
d = 2 * n[0]

for i in range(n[0]+1):
  if(n[1] == d):
    print("Yes")
    exit()
  d = d + 2  

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Choniki = 2*X
Boniki = 4*X

if Y%2==0 and Y<= Boniki and Y>= Choniki:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

answer = "No"

for i in range(animals + 1):
	if i * 4 + (animals - i) * 2 == legs:
		answer = "Yes"
		break
        
print(answer)

Submission status: Accepted

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

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

if (4 * kame) + (2 * tsuru) == y and kame >= 0 and tsuru >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
num_animals, num_legs = list(map(int, input().split()))
# print(crane, turtle)

num_turtle = -num_animals + (num_legs / 2)
num_cranies = num_animals - num_turtle
# print(num_turtle, num_cranies)

answer = num_turtle >= 0 and num_turtle.is_integer() and num_cranies >= 0 and num_cranies.is_integer()
answer = 'Yes' if answer else 'No'

print(answer)

# a + b = X
# 2a + 4b = Y

# a = X - b
# 2(X - b) + 4b = Y
# 2X - 2b + 4b = Y
# 2X + b(-2 + 4) = Y
# 2X + 2b = Y
# 2b = -2X + Y
# b = -X + Y

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:
num, legs = map(int, input().split())

flag = 1
tmp = num * 4
for i in range(num+1):
    if(tmp == legs):
        print("Yes")
        flag = 0
        break
    else:
        tmp -= 2
if(flag == 1):
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
#x = list(map(int, input().split()))
#A.sort()
ans = "No"
if Y % 2 == 0 and 2*X <= Y <= 4*X:
    ans = "Yes"
print(ans)

Submission status: Accepted

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

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

ans = "No"
if a >= 0 and b >= 0:
    if a % 2 ==0 and b % 2 == 0:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
x,y = map(int,input().split())
# x = list(map(int,input().split()))
a = 2*x - y/2
b = y/2 - x
if (a >= 0) & (b >= 0):
    if (a.is_integer()) & (b.is_integer()):
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = (int(i) for i in input().split())
sum_foots = 4*x
while(sum_foots >= 2*x):
    if sum_foots == y:
        print('Yes')
        exit()
    sum_foots -= 2
   
print('No')

Submission status: Accepted

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

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


def solve(X: int, Y: int):
    if (4*X-Y)%2 == 1:
        print(NO)
        exit()
    if (Y-2*X)%2 == 1:
        print(NO)
        exit()
    if 4*X-Y < 0:
        print(NO)
        exit()
    if Y-2*X < 0:
        print(NO)
        exit()

    print(YES)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

Solution code:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


def MAP(): return map(int, input().split())


def LIST(): return list(map(int, input().split()))


def ZIP(n): return zip(*(MAP() for _ in range(n)))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    X, Y = MAP()
    for i in range(X+1):
        if 2*i + 4*(X-i) == Y:
            print("Yes")
            exit()
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# X:動物の総数　Y:足の総数
X, Y = map(int, input().split())
turu_a = X * 2
kame_a = X * 4
if turu_a <= Y and Y <= kame_a and Y%2 == 0 and (kame_a - turu_a) % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

print('No')

'''
import sympy
#from numpy.linalg import solve
A, B = map(int, input().split())
# solve([x + y=A, 2 * x + 4 * y=B], [x, y])
x = sympy.Symbol('x')
y = sympy.Symbol('y')
eq1 = x + y - A
eq2 = 2 * x + 4 * y - B
aa = sympy.solve([eq1, eq2])
'''

Submission status: Accepted

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

Submission status: Accepted

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

low = 2*X
upper = 4*X

if low <= Y and Y <= upper and Y % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
X,Y = (int(x) for x in input().split())
Flag = False
for A in range(0,X+1):
    for B in range(0,X+1):
        if A+B==X and 2*A+4*B==Y:
            Flag = True
    if Flag:
        break
if Flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

a = (y//4+1)
ans=0
for i in range(a):
    turtle = (y-(4*i))/2
    if i + turtle == x:
        ans += 1
if ans == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

X, Y = input_int()

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

Submission status: Accepted

Solution code:
from math import gcd
from functools import reduce
from itertools import product
import numpy as np

def resolve():
  X, Y = map(int, input().split(" "))
  if Y%2 != 0:
    print("No")
    return True
  if Y < (2*X):
    print("No")
    return True
  if Y > (4*X):
    print("No")
    return True
  print("Yes")

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    l = list()
    l.append(2*x)
    for i in range(1, x+1):
        l.append(2*x + i*2)
    if y in l:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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:
import sys
X,Y = map(int,input().split())
for i in range(X+1):
  if 2*i+4*(X-i)==Y:
    print("Yes")
    sys.exit()
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:
I1 = input().split()
X, Y = int(I1[0]), int(I1[1])
a = int(Y-2*X)
b = int(4*X-Y)
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())
if x*2<=y and x*4>=y and (x*2-y)%2==0 :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=b-(2*a)
if(c<0 or c%2):print("No");
else:
  d=c//2;e=a-d;
  if(e>=0):print("Yes");
  else:print("No");

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
lst = []
if y < x * 2 or y > x * 4 :
    print('No')
else :
    i = x * 2
    while i <= x * 4 :
        lst.append(i)
        i += 2
    if y in lst :
        print('Yes')
    else :
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for t in range(X+1):
    k = X - t
    if Y == t * 2 + k * 4:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d=(4*X-Y)/float(2.0)
if d==int(d) and 0<=d and d <= X:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = (4*X - Y)/2
y = (-2*X + Y)/2

if x == int(x) and y == int(y) and x >= 0 and y >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

left=[[1,1],[2,4]]
right=[X,Y]

a=solve(left,right)

if a[0] >=0 and a[1] >= 0 and a[0].is_integer() and a[1].is_integer():
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def read_input(trans=int):
    return list(map(trans, input().split()))


X, Y = read_input()

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

if (k-int(k) != 0) or (t-int(t) != 0) or ((0 <= k <= X) == False) or ((0 <= t <= X) == False):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for turu in range(0, 51):
    kame = x - turu
    if turu * 2 + kame * 4 == y:
        ans = "Yes"
if ans == 0:
    print("No")
else:
    print(ans)

Submission status: Accepted

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

for i in range(X+1):
    f = (2 * i) + 4 * (X - i)
    if f == Y:
        print("Yes")
        break
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 = list(map(int, input().split()))

a = x * 2
b = x * 4

if a <= y and y <= b and (y % 2 == 0):
    print('Yes')

else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

turu = 2*x
came = 4*x

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

Submission status: Accepted

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

if m/4<=n<=m/2 and m%2==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

a=x*2
b=x*4

if y%2==0:
    if a<=y<=b:
        z="Yes"
    else:
        z="No"
else:
    z="No"

print(z)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from scipy.sparse.csgraph import floyd_warshall
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    x,y = inpm()
    if 2*x <= y and y <= 4*x and y%2 == 0:
        print('Yes')
    else:
        print('No')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

a = 0

for i in range(x):

  z1 = (i+1) * 2 + (x - i - 1) * 4
  z2 = (i+1) * 4 + (x - i - 1) * 2

  if z1 == y or z2 == y: 
    print("Yes")
    a += 1
    break

if a == 0:
  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:
import sys
x, y = map(int, input().split())

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

print("No")

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

x,y = mi()

if (4*x-y)%2 == 0 and (4*x-y)>=0 and (y-2*x)>=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')
    break
else:
  print('No')

Submission status: Accepted

Solution code:
temp = input().split(" ")

temp = [int(i) for i in temp]

x = temp[0]
y = temp[1]

flag = False

for i in range(0, 101):
    if flag:
        break
    for j in range(0, 101):
        if flag:
            break

        total = i + j
        foots = 2 * i + 4 * j

        if total == x and foots == y:
            print('Yes')
            flag = True

if not flag:
    print('No')

Submission status: Accepted

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

for a in range(0, X+1):
	y = 4*a + 2*(X-a)
	if Y == y:
		print("Yes")
		exit()
print("No")

Submission status: Accepted

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

crain = (4*X-Y)/2
turtle = (Y-2*X)/2

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

Submission status: Accepted

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

Submission status: Accepted

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

q=(4*x-y)%2
turu=(4*x-y)/2

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

Submission status: Accepted

Solution code:
from numpy.linalg import solve
X,Y = map(int,(input().split()))
left = [[1, 1],[2, 4]]
 
right = [X, Y]

if(int(solve(left, right)[0])>=0 and int(solve(left, right)[1])>=0 and solve(left, right)[0].is_integer() and solve(left, right)[1].is_integer()):
  print("Yes")
else:
  print("No")