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

Submission status: Accepted

Solution code:
def main():
  a=list(map(int,input().split()))
  for i in range(a[0]+1):
    if(2*a[0]+2*i==a[1]):
      print("Yes")
      return 0
  print("No")
  return 0
    
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')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
m = 2 * X
M = 4 * X

if Y % 2 == 1:
    print("No")
elif Y > M or Y < m:
    print("No")
else:
    print("Yes")

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:
x,y=[int(i) for i in input().split()]
turu=x*2
kame=x*4
if turu<=y and kame>=y and y%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

T = 0
K = X

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x,y  = map(int,input().split())
a= y/2-x
b = 2*x-y/2
if y%2!=0:
  print('No')
else:
  if 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:
    print('Yes')
elif x*2>y:
    print('No')
elif (y-x*2)%2==0 and (y-x*2)//2<=x:
    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:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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


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

if flag == 1:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:

import numpy as np
x,y=list(map(int,input().split()))
A=[[1,1],[2,4]]
b=[x,y]
c,d=np.linalg.solve(A,b)

if c>=0 and d>=0 and c==int(c) and d==int(d):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math


#t = int(input())
tmp = input().split()
x,y = list(map(lambda a: int(a), tmp))
if(y<2*x):
	print("No")
	sys.exit()
if(y>4*x):
	print("No")
	sys.exit()
if(((4*x)-y)%2==1):
	print("No")
	sys.exit()
print("Yes")

Submission status: Accepted

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

if x*4 < y or x*2 > y or y%2 == 1 :
    ans = False

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

Submission status: Accepted

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

if y % 2 == 1:
    print('No')
    exit()

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

Submission status: Accepted

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

def check(kame, tsuru):
    if kame*4 + tsuru*2 == y:
        return True
def checkWhole():
    for kame in range(x+1):
        if check(kame, x-kame):
            return True
    return False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###################################################
#                                                 #
#   author: raghav_0901 (Raghav Dalmia)           #
#   updated on: Sunday, 14-06-2020, 17:36:42 pm   #
#                                                 #
###################################################

from math import *


def _in():
    return [int(x) for x in input().split(' ')]


def is_int(n):
    return floor(n) == ceil(n)


def main():
    x, y = _in()
    t = (y - (2 * x)) / 2
    c = ((4 * x) - y) / 2
    if(is_int(t) and is_int(c) and c >= 0 and t >= 0):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    tt = 1
    # tt = int(input())
    for _ in range(tt):
        main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

is_exit = False

for t in range(0, 101):
    for k in range(0, 101):
        if t + k == x and 2*t + 4*k == y:
            is_exit = True
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
X, Y = map(int, readline().split())
x = 2*X
if x > Y:
  print('No')
  sys.exit()
for i in range(X+1):
  if (x + 2*i) == Y:
    print('Yes')
    sys.exit()
print('No')

Submission status: Accepted

Solution code:
import sys

X, Y = [int(n) for n in input().split()]

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

print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
X, Y = map(int, input().split())
# 文字列の入力
#s = input()
#開業されたN個要素を受け付ける
#input_list = [list(map(int, input().split())) for i in range(N)]

ans = "Yes"

if not Y%2 == 0:
    ans = "No"
elif Y < 2*X:
    ans = "No"
elif 4*X < Y:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
x,y= map(int, input().split())
s=(y-2*x)
t=(4*x-y)
if s%2==0 and t%2==0 and s>=0 and t>=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):
    if Y == (2*i + 4*(X-i)):
        flag = True

if flag:
    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())
flag = False
for i in range(0, X+1):
    nokori = Y - i*2
    if (X-i) * 4 == nokori:
        flag = True
        break
print('Yes' if flag else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

A = list(map(int,stdin.readline().split()))

if A[1]-2*A[0]<0:
    print('No')
else:
    if (A[1]-2*A[0])%2==0:
        if (A[1]-2*A[0])/2>A[0]:
            print('No')
        else:
            print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for a in range(X+1):
    if Y == 2*(X-a) + 4 * a:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

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

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

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

    if a % 2 == 0 and b % 2 == 0:
        if a >= 0 and b >= 0:
            print("Yes")
        else:
            print("No")
    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:
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


def solve(x, y):
    min_legs = 2 * x
    max_legs = 4 * x
    return (min_legs <= y <= max_legs) and y % 2 == 0



if __name__ == "__main__":
    x, y = arr_in()
    out("Yes" if solve(x, y) else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = [int(j) for j in input().split()]
if (b-2*a)%2==0 and (b-2*a)>=0:
    if (b-2*a)//2<=a:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
# from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

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

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

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

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input().split()) for _ in range(n) ]

x,y = MI()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

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

def resolve():
    readline=sys.stdin.readline

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

    for a in range(101):
        for b in range(101):
            if ((a+b)==x) and ((a*2 + b*4)==y):
                print("Yes")
                return
    print("No")
    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

Solution code:
import itertools
X, Y = list(map(int, input().split(' ')))
for i in itertools.combinations_with_replacement([2,4],X):
    if sum(i)==Y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

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

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

print('No')

Submission status: Accepted

Solution code:
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")
            exit(0)
print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

y_min, y_max = 2 * X, 4*X

ans = "No"

if (y_min <= Y <= y_max) and (Y%2 == 0):
    ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率

def input(): return sys.stdin.readline()[:-1]
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    #N = int(input())
    X,Y = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

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




if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if a>=0 and b>=0 and a%1==0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

X, Y = nn()

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

Submission status: Accepted

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    x,y  = map(int,input().split())
    if y-2*x<0:
        print('No')
    else:
        if (y-2*x)%2==1:
            print('No')
        else:
            b = (y-2*x)//2
            if x-b>=0:
                print('Yes')
            else:
                print('No')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from collections import deque
from itertools import *

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

X,Y = LI()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if y < 0:
  print('No')
  exit()

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

Submission status: Accepted

Solution code:

def resolve():
    x, y = map(int, input().split())
    OK = False
    for i in range(x+1):
        t = i
        k = x-i
        if i*2+k*4 == y:
            OK = True
    print ("Yes") if OK else print("No")

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import decimal
import math
import collections
import sys
input = sys.stdin.readline

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

#ListA=list(map(int,input().split()))


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

print(ans)

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
X, Y = map(int, input().split())

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

if y < 0 or x < 0 or x + y != X or 2 * x + 4 * y != Y:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

else:
    print("No")

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

x,y = imap()
a = 2*x - y//2
b = -x + y//2

ans = "Yes"
if a<0 or b<0: ans = "No"
if y%2 != 0: ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for c in range(X+1):
  t = X - c
  if 2*c + 4*t == Y:
    print("Yes")
    exit()
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:
import sys
input = sys.stdin.readline

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

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)
    b.append(B)'''

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

for i in range(x+1):
    if 2*(x-i)+4*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 2*i + 4*(X-i) == Y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

is_found = False

for t in range(101):
    for k in range(101):
        if t + k == X and 2*t + 4*k == Y:
            is_found = True
            break

    if is_found:
        break

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
# from fractions import gcd

MOD = 10 ** 9 + 7
# MOD = 998244353
# sys.setrecursionlimit(10**8)

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

Submission status: Accepted

Solution code:
X, Y = list(map(int, input().split()))
flg = 0
for i in range(100):
    for j in range(100):
        if i + j == X and 2 * i + 4 * j == Y:
            print("Yes")
            flg = 1
            break
if flg == 0:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = list(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:
#B
x,y = map(int,input().split())
flg = False
for i in range(101):
    if x - i >= 0:
        a = i
        b = x - a
        if a * 2 + 4 * b == y:
            flg = True
            break
        
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

for x in range(0,101):

    y = X-x
    if y<0:
        continue
    if x*2 + y*4 == Y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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

def answer():
    if y % 2 == 1:
        return False

    a = 2 * x - y // 2
    b = - x + y // 2

    return (0 <= a and 0 <= b)


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
C = 2
T = 4

for t in range(X+1):
    if t * T + (X-t) * C == 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")