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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ok = False
for i in range(101):
    for j in range(101):
        if i+j == x and 2*i+4*j == y:
            ok = True

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=[int(i) for i in input().strip().split(' ')]
var='Yes'
if y%2 != 0 or y>4*x or y<2*x:
	var='No'
print(var)

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:

def main():
    X, Y = map(int, input().split())
    for a in range(0, X + 1):
        if Y == 4 * a + 2 * (X - a):
            print('Yes')
            return
    print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = list(map(int,input().split()))
for i in range(X+1):
  for j in range(X+1):
    if i + j == X and 2 * i + 4 * j == 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");break
else:
  print("No")

Submission status: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in range(base**n):s=[tb//(base**bt)%base for bt in range(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
 
YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
input=lambda: sys.stdin.readline().rstrip()

class Tree:
    def __init__(self,inp_size=None,ls=None,init=True,index=1):
        self.LCA_init_stat=False
        self.ETtable=[]
        if init:
            if ls==None:
                self.stdin(inp_size,index=index)
            else:
                self.size=len(ls)+1
                self.edges,_=GI(self.size,self.size-1,ls,index=index)
        return
 
    def stdin(self,inp_size=None,index=1):
        if inp_size==None:
            self.size=int(input())
        else:
            self.size=inp_size
        self.edges,_=GI(self.size,self.size-1,index=index)
        return
    
    def listin(self,ls,index=0):
        self.size=len(ls)+1
        self.edges,_=GI(self.size,self.size-1,ls,index=index)
        return
 
    def dfs(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
        return v
 
    def bfs(self,x,func=lambda pr,prv,nx,dist:prv+dist,root_v=0):
        q=deque([x])
        v=[None]*self.size
        v[x]=root_v
        while q:
            c=q.popleft()
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=func(c,v[c],nb,d)
        return v
 
    def parent(self,x):
        return self.dfs(0,func=lambda pr,prv,nx,dist:pr,root_v=-1)
 
    def topological_sort(self,x):  # return topological sort of the tree
        tps=[]
        q=deque([x])
        v=[None]*self.size
        v[x]=0
        while q:
            c=q.popleft()
            tps.append(c)
            for nb,d in self.edges[c]:
                if v[nb]==None:
                    q.append(nb)
                    v[nb]=0
        return tps
 
    def EulerTour(self,x):
        q=deque()
        q.append(x)
        self.depth=[None]*self.size
        self.depth[x]=0
        self.ETtable=[]
        self.ETdepth=[]
        self.ETin=[-1]*self.size
        self.ETout=[-1]*self.size
        cnt=0
        while q:
            c=q.pop()
            if c<0:
                ce=~c
            else:
                ce=c
                for nb,d in self.edges[ce]:
                    if self.depth[nb]==None:
                        q.append(~ce)
                        q.append(nb)
                        self.depth[nb]=self.depth[ce]+1
            self.ETtable.append(ce)
            self.ETdepth.append(self.depth[ce])
            if self.ETin[ce]==-1:
                self.ETin[ce]=cnt
            else:
                self.ETout[ce]=cnt
            cnt+=1
        return
    
    def LCA_init(self,root):
        self.EulerTour(root)
        self.st=SparseTable(self.ETdepth,init_func=min,init_idl=inf)
        #self.st=SegTree(self.size*2-1,self.ETdepth,function=min,ide=inf)
        self.LCA_init_stat=True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            self.LCA_init(root)
        xin,xout=self.ETin[x],self.ETout[x]
        yin,yout=self.ETin[y],self.ETout[y]
        a=min(xin,yin)
        b=max(xout,yout,xin,yin)
        id_of_min_dep_in_et=self.st.query_id(a,b+1)
        return self.ETtable[id_of_min_dep_in_et]
 
    def __str__(self):
        return  str(self.edges)
 
    def show(self):
        if all([all([d==1 for nd,d in edge]) for edge in self.edges]):
            print( [[nd for nd,d in edge] for edge in self.edges] )
        else:
            print(self)
 
class SparseTable: # O(N log N) for init, O(1) for query(l,r)
    def __init__(self,ls,init_func=min,init_idl=float('inf')):
        self.func=init_func
        self.idl=init_idl
        self.size=len(ls)
        self.N0=self.size.bit_length()
        self.table=[ls[:]]
        self.index=[list(range(self.size))]
        self.lg=[0]*(self.size+1)
        
        for i in range(2,self.size+1):
            self.lg[i]=self.lg[i>>1]+1
 
        for i in range(self.N0):
            tmp=[self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) for j in range(self.size)]
            tmp_id=[self.index[i][j] if self.table[i][j]==self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) else self.index[i][min(j+(1<<i),self.size-1)] for j in range(self.size)]
            self.table+=[tmp]
            self.index+=[tmp_id]
    
    # return func of [l,r)
    def query(self,l,r):
        if r>self.size:r=self.size
        #N=(r-l).bit_length()-1
        N=self.lg[r-l]
        return self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))])
    
    # return index of which val[i] = func of v among [l,r)
    def query_id(self,l,r):
        if r>self.size:r=self.size
        #N=(r-l).bit_length()-1
        N=self.lg[r-l]
        a,b=self.index[N][l],self.index[N][max(0,r-(1<<N))]
        if self.table[0][a]==self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))]):
            b=a
        return b
    
    # return boundary index of r such that func({table[i]} =< x , i in [pos,r]
    def right_bound(self,pos,x):
        k=(self.size-pos).bit_length()
        for j in range(k)[::-1]:
            nx=pos+(1<<j)
            if nx<n and self.query(pos,nx+1)<=x:
                pos+=(1<<j)
        return pos
    
    # return boundary index of l such that func({table[i]} =< x , i in [l,pos]
    def left_bound(self,pos,x):
        k=pos.bit_length()
        for j in range(k)[::-1]:
            nx=pos-(1<<j)
            if 0<=nx and self.query(nx,pos+1)<=x:
                pos-=(1<<j)
        return pos
 
    def __str__(self):
        return str(self.table[0])
 
    def print(self):
        for i in self.table:
            print(*i)
 
show_flg=False
show_flg=True
ans=0

x,y=LI()
for i in rep(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())
answer=0
for i in range (0,X+1):
  if 4*(X-i) + 2*i == Y:
    answer = 1
if answer == 1:
  print('Yes')
else:
  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):
    # a + b = X
    # 2a+4b = Y
    ret = Y - 2 * X
    if ret >= 0 and ret % 2 ==0:
        b = ret // 2
        a = X - b
        if a >= 0:
            print(YES)
        else:
            print(NO)
    else:
        print(NO)
    return


# 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:
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:
X,Y=map(int,input().split())
print('Yes' if Y%2==0 and 2*X<=Y and Y<=4*X else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = [int(i) for i in input().split()]
print("Yes") if (((4*x)-y)/(2) >= 0 and (y-(2*x))/(2) >= 0) and (((4*x)-y)/(2))-int(((4*x)-y)/(2)) == 0 and ((y-(2*x))/(2))-int((y-(2*x))/(2)) == 0 else print("No")

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
x=a[0]
y=a[1]
if x*2>y or x*4<y or y%2!=0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

for i in range(101):
    n = i
    k = X - i
    if 0 > k or k > 100:
        continue
    if Y == n * 2 + k * 4:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

if (X>=Y or Y%2 or Y>4*X or Y<2*X):
  print('No')
elif(Y<=4*X and Y>=2*X):
  print('Yes')

Submission status: Accepted

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

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

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

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

print(flg)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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(0)
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(0)
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())
for tsuru in range(51):
    for kame in range(26):
        if (tsuru + kame == x) and (2 * tsuru + 4 * kame == y):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
animals, legs = [int(i) for i in input().split()]

cranes = 2
turtle = 4

for i in range(0, animals + 1):
    for j in range(0, animals + 1):
        number = (2*i) + (4*j)
        if i + j == animals and number == legs:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

for x in range(int(X)+1):
    a = x
    b = int(X) - a
    y = 4*a + 2*b
    if int(Y) == y:
        counter = 1
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

for a in range(x+1):
	if 2*a + 4* (x-a)==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()
print('No')

Submission status: Accepted

Solution code:
from __future__ import division, print_function
import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase
import __pypy__

# region fastio
BUFSIZE = 8192
class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()
class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)
    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()
def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()
sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

# from types import GeneratorType
# def bootstrap(func, stack=[]):
#     def wrapped_function(*args, **kwargs):
#         if stack:
#             return func(*args, **kwargs)
#         else:
#             call = func(*args, **kwargs)
#             while True:
#                 if type(call) is GeneratorType:
#                     stack.append(call)
#                     call = next(call)
#                 else:
#                     stack.pop()
#                     if not stack:
#                         break
#                     call = stack[-1].send(call)
#             return call
#     return wrapped_function

def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7


x,y = Ri()
val = (y-2*x)/2

if ceil(val) == val:
    y = x-ceil(val)
    if ceil(val) >= 0 and y >= 0:
        Yes()
    else:
        No()
else:
    No()

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    x, y = map(int, input().split())
    if y & 1:
        print("No")
        return
    print("Yes" if 2 * x <= y <= 4 * x else "No")
resolve()

Submission status: Accepted

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

else:
    print('No')

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

ans = 'No'

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

print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if 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());
large = x*4;
small = x*2;
flag = False;
for i in range(small,large+1,2):
    if(i==y):
        flag = True;
        break;
if flag :
    print("Yes");
else:
    print("No");


# 5

# 4   2
# 5   0 = 20;
# 4   1 = 18;
# 3   2 = 16;
# 2   3 = 14;
# 1   4 = 12;
# 2   5 = 10;

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


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


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    X, Y = map(int, input().split())
    if (Y - 2 * X) % 2 != 0:
        print("No")
        return
    kame = (Y - 2 * X) // 2
    if 0 <= kame <= X:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

#全探索法
for i in range(x+1):
    t = int(x-i)
    asi = int(i*2 + t*4)
    if asi == y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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

C = (X * 4 - Y) / 2

if (C * 10) % 10 == 0 and 0 <= C <= X:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
for i in range(X+1):
    if Y==2*i+4*(X-i):
        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())
minn = x*2
maxx = x*4
if y%2 != 0 or y < minn or y > maxx:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    x, y = LI()
    for i in range(x + 1):
        j = x - i
        if i * 2 + j * 4 == y:
            print("Yes")
            return
    print("No")

    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    if 2 * x <= 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())

T = 0
C = 0

if Y > X * 4:
    print("No")
    exit()

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

print("No")

Submission status: Accepted

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

tu = 0
ashi = 0

while tu <= X :
  
  ka = X-tu
  ashi = 2*tu + 4*ka
  
  if ashi == Y:
    print("Yes")
    exit()
  else:
    tu += 1

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=[int(x) for x in input().rstrip().split()]
y=float((Y-2*X)/2)
x=float(X-y)

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

Submission status: Accepted

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

flg = 0

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

    if flg == 1:
        break
    #print(i,x-i,2*i + 4*(x-i))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
turu, kame = (0, 0)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

X, Y = LI()
ans = True
if Y % 2 == 1:
    ans = False

if X * 2 <= Y <= X * 4:
    pass
else:
    ans = False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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