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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
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()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    x,y=MI()
    if (y-2*x)%2==0 and (y-2*x)//2>=0 and x-(y-2*x)//2>=0:print("Yes")
    else:print("No")

main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint


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


inf = float('inf')
mod = 10 ** 9 + 7


def pprint(*A):
    for a in A:     print(*a, sep='\n')


def INT_(n): return int(n) - 1


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


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [I() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


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


def F(): return float(input())


def ST(): return input().replace('\n', '')


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ok = False
for i in range(x+1):
  tmp = 2*i + 4*(x-i)
  if tmp == y:
    ok = True
    break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = "No"

turtle2 = Y-2*X

if turtle2%2==0 and turtle2 >=0 and turtle2 <=X*2:
    ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=list(map(int,input().split()))
if x[0]*2<=x[1] and 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())

is_exist = False
for a in range(51):
    for b in range(26):
        if a + b == x and a*2 + b*4 == y:
            is_exist = True
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
sys.setrecursionlimit(10 ** 7)
#from heapq import heappop, heappush
#from collections import defaultdict
# import math
# from itertools import product, accumulate, combinations, product
# import bisect# lower_bound etc
#import numpy as np
# from copy import deepcopy
#from collections import deque
#import numba
#import math

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


if __name__ == "__main__":
    run()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding cell (SUBMIT ONLY THIS CELL)

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

for a in range(X + 1):
    if a * 2 + (X - a) * 4 == 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 i*2+(X-i)*4 == Y:
        print('Yes')
        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:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    X, Y = map(int, rl().split())
    
    for i in range(X + 1):
        if 2 * i + 4 * (X - i) == Y:
            print('Yes')
            return
    print('No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n_creature, n_legs = map(int,input().split())
res = 'No'
for n_turu in range(n_creature+1):
    if 2 * n_turu + 4 * (n_creature-n_turu) == n_legs:
        res = 'Yes'
print(res)

Submission status: Accepted

Solution code:
# B

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())
flag = False
for turu in range(0,x+1):
  kame = x - turu
  if y == (turu*2 + kame*4):
    flag = True

if flag:
    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")
        break
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
line = input().split()
num = int(line[0])
leg = int(line[1])

if leg > 4 * num or leg < 2 * num or leg%2 != 0:
  ans = "No"

else:
  ans = "Yes"
  
print(ans)

Submission status: Accepted

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

lst = []
for i in range(X+1):
  lst.append(2*X + 2*i)

lst = set(lst)

if Y in lst:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if S[1]%2==0:
  if S[0]*2<=S[1]<=S[0]*4:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in input().split()]
if (Y - 2 * X) % 2 == 0 and 0 <= (Y - 2 * X) // 2 <= 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:
#!/usr/bin/env python3

from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.buffer.readline
INF = float('inf')


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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

b1 = int(b)
a1 = int(a)

if (b1 < 0 or b1 != b) or (a1 < 0 or a1 != a):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

if X * 4 < Y or X * 2 > Y:
    print('No')
elif Y % 2 == 1:
    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 a * 2 + b * 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 i * 2 + (x-i) * 4 == y:
        print('Yes')
        exit(0)
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import copy
from collections import deque
stdin = sys.stdin

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

x, y = na()

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

Submission status: Accepted

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

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

for k in range(0,101):
    for t in range(0,101):
        if k+t == 0:
            continue
        if x == k+t and y == (4*k)+(t*2):
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

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

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

if (0 <= a) and (0 <= b):
  if (a % 1 == 0) and (b % 1 == 0):
    print("Yes")
    quit()
    
print("No")

Submission status: Accepted

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

ans = 'No'
if y % 2 == 0:
    turu = y // 2 - x
    kame = 2*x - y // 2
    if turu >= 0 and kame >= 0:
        ans = 'Yes'
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

kame=0
turu=0

asi=0
flag=0

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

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

Submission status: Accepted

Solution code:
from sys import stdin
X,Y = [int(x) for x in stdin.readline().rstrip().split()]
f = False
for i in range(0,X+1):
    j = X - i
    if i*2 + j*4 == Y:
        f = True
            
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for turu in range(X+1):
    kame = X - turu
    if 2 * turu + 4 * kame == Y:
        flag = True
print('Yes' if flag else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""    Arnab Chanda    """

from collections import defaultdict, deque
from itertools import permutations
from sys import stdin,stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq

int_input=lambda : int(stdin.readline())
string_input=lambda : stdin.readline().split()
multi_int_input =lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input=lambda : list(map(int,stdin.readline().split()))
string_list_input=lambda: list(string_input())
MOD = pow(10,9)+7

x, y = multi_int_input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict
it = lambda: list(map(int, input().strip().split()))
INF = float('inf')

def solve():
    X, Y = it()
    if Y % 2:
        return False
    return 4 * X >= Y >= 2 * X

if __name__ == '__main__':
    if not solve():
        print('No')
    else:
        print('Yes')

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
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np
import math
from collections import deque
from collections import defaultdict
from math import gcd


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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def main():
    input = sys.stdin.buffer.readline
    x, y = map(int, input().split())
    print('Yes' if 2 * x <= y <= 4 * x and y % 2 == 0 else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X,Y  = map(int, input().split()) 
    XY = [False]*(600)
    for i in range(X+1):
        XY[(X-i)*2+i*4]=True
    if XY[Y]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if __name__ == "__main__":
    print(main(X,Y))

Submission status: Accepted

Solution code:

import sys
import math
import itertools
import collections

def solve(X,Y):
    for i in range(X+1):
        j = X - i
        if(i * 2 + j * 4 == Y):
            return "Yes"
    else:

        return "No"
def main():
    X,Y = map(int,input().split())
    # solve()
    print(solve(X,Y))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# Problem B - Crane and Turtle

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

# initialization
is_ok = False

# count
for a in range(X+1):
    b = X - a
    if (2*a + 4*b)==Y:
        is_ok = True

# output
if is_ok:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
if (Y-2*X)%2 == 0 and Y-2*X >=0 and Y%2==0 and 4*X - Y >= 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:
x, y = map(int, input().split())
ans = "No"
for a in range(100):
    for b in range(100):
        if a + b == x and 2 * a + 4 * b == y:
            ans = "Yes"
print(ans)

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:
a,b = map(int,input().split())
if b % 2 == 1:
    print("No")
else:
    if a*2 <= b and b<= a*4:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

Solution code:
# めんどくさいので総当り
X,Y = map(int,input().split())
for i in range(X+1):
    kame = i
    tsuru = X-i
    if kame*4 + tsuru*2 == Y:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

if Y%2!=0:
    print("No")
elif 2*X<=Y<=X*4:
    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())

z = y%2

if z !=0:
    print("No")
    exit()
    
if y >= 2*x and y <= 4*x:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

# 2x = b-2a
ans1 = ((b - 2 * a) % 2) == 0
x2 = b - 2 * a
ans = True
if x2 % 2 != 0:
    ans = False
if x2 < 0:
    ans = False
x2 = x2 // 2
if a - x2 < 0:
    ans = False
if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
import itertools,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
X,Y = LI()
for x,y in itertools.product(range(X+1),range(Y+1)):
    if x+y==X and 2*x+4*y==Y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

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

if not even(y):
    print("No")
    exit()

mn = 2*x
mx = 4*x

if mn <= y <= mx:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main(sys.stdin.readline, print)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = "Yes"

if Y % 2 == 1:
    ans = "No"
else:
    Y //= 2
    mi = (Y+1)//2
    if mi <= X <= Y:
        pass
    else:
        ans = "No"

print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if Y > 4*X:
    print("No")
    exit()

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

if Y < 2*X:
    print("No")
    exit()


print("Yes")

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in 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())

bool = False

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = "Yes"
if (Y % 2 == 1):
  ans = "No"
elif (X*4 < Y):
  ans = "No"
elif (Y < X * 2):
  ans = "No"

  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if y%2==1:
    print('No')
    exit(0)

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

print('Yes')

Submission status: Accepted

Solution code:
import sys
x,y=map(int,input().split())
for i in range(0,101):
    for j in range(0,101):
        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())

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

Submission status: Accepted

Solution code:
import math as mt
#import numpy as np

def ro(n):
  return mt.floor(mt.sqrt(n))
def ya():
  print("Yes")
  return
def na():
  print("No")
  return


a,b=map(int,input().split())
#lis=list(map(int,input().split()))
#n=int(input())
#s=input()

if b%2:
  na()
elif b>a*4:
  na()
elif a*2>b:
  na()
else:
  ya()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b = map(int,input().split())
count = 0
for i in range(a + 1):
    if (i * 2 + (a - i) * 4) == b:
        count += 1
if count == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

j=0
b=0
for i in range(x+1):
    a=0
    j=x-i
    a=i*2+j*4
    if a==y:
        b=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

X, Y = getNM()
for i in range(X + 1):
    crane = i
    turtle = X - i
    if (2 * crane) + (4 * turtle) == Y:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

for crane in range(anims + 1):
    if crane * 2 + (anims - crane) * 4 == legs:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

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

if count == X+1:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

if (4*x-y)% 2== 1:
  print("No")
  quit()

if (4*x-y)/2 > x:
  print("No")
  quit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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