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

Submission status: Accepted

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

yesno = 'No'

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

if Y%2==0 and a>=0 and b>=0:
    yesno = 'Yes'
print(yesno)

Submission status: Accepted

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

all_crane_num = x * 2
diff = y - all_crane_num

turtle_num = int(diff / 2)
crane_num = x - turtle_num

if turtle_num >= 0 and crane_num >= 0 and turtle_num*4 + crane_num*2 == y:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

# 実行環境(0:vscode, 1:atcoder)
MODE = 1

# 入力の次元
DIMENSION = 1

# int型に変換
INT_TYPE = 1

if not (MODE):
    with open("input.txt", "r") as f:
        s = f.read()
else:
    s = sys.stdin.read()

if DIMENSION == 0:
    if INT_TYPE == 1:
        s = int(s)
elif DIMENSION == 1:
    if INT_TYPE == 0:
        s = s.split()
    elif INT_TYPE == 1:
        s = [int(x) for x in s.split()]
elif DIMENSION == 2:
    if INT_TYPE == 0:
        s = [x.split() for x in s.splitlines()]
    elif INT_TYPE == 1:
        s = [[int(y) for y in x.split()] for x in s.splitlines()]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if (a >= 0 and b >= 0)  and (a%1 == 0 or b%1 == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

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

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

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
k = x*4
if k < y: exit(print('No'))
if k == y: exit(print('Yes'))

for i in range(x):
    k -= 2
    if k == y: exit(print('Yes'))
print('No')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
ju = 0
for i in range(0,x+1):
    an = 2*i+4*(x-i)
    if an ==y:
        ju=1
        break

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

atama = num[0]
ashi = num[1]

a = 2*atama - ashi/2
b = ashi/2 - atama

if(a.is_integer() and b.is_integer() and a>=0 and b>=0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin

x, y = [int(x) for x in stdin.readline().rstrip().split()]


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

Submission status: Accepted

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

for a in range (101):
    for b in range (101):
        if (a + b == x) and (2*a + 4*b == y):
            print('Yes')
            exit(0)

print('No')

Submission status: Accepted

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

if b==int(b) and b>=0 and a==int(a) and a>=0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

tsuru = 0
kame = 0

kame = (Y - 2 * X) / 2

if kame.is_integer() & (kame >= 0) & (kame <= X):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N , M = (map(int , input().split()))
if M % 2 != 0:
    print("No")
elif (N*2) > M:
    print("No")
elif (M % 4 == 0 or M % 4 == 2) and M <= (N*4):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

x, y = [int(m) for m in input().split()]

for kn in range(x+1):
    tn = x - kn
    if kn * 4 + tn * 2 == 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 Y == 2*i + 4*(X - i):
        print('Yes')
        quit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
a = (4*X-Y)/2
b = (Y-2*X)/2

if a >= 0 and b >= 0:
    if a.is_integer() == True and b.is_integer() == True:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

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

print(ans)

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

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split()) 
if a*2>b:
    print("No")
    exit()
    

num=a*4
while 1:
    if num==b:
        print("Yes")
        exit()
        
    elif num<b:
        break
    num=num-2        
    
print("No")

Submission status: Accepted

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

#print(X, Y)

if Y < 2 * X:
    print('No')
    exit()
elif Y > 4 * X:
    print('No')
    exit()

y = (Y - 2 * X)

#print(y, y / 2)
if y >= 0 and (y % 2 == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
for i in range(1000):
    if 2*i==y-2*x:
        if i>x:
            print("No")
            quit()
        else:
            print("Yes")
            quit()
print("No")

Submission status: Accepted

Solution code:
# template by 3xC and starkizard.
# contributors: 

#####################################################################################
from __future__ import division, print_function 

import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io


"""Uncomment modules according to your need"""


# from bisect import bisect_left, bisect_right, insort
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from copy import deepcopy
# from decimal import *
# import re
# import operator

#####################################################################################
# this enables you to write python3 code with PyPy2 (Python 2)
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

#####################################################################################

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""Uncomment next 4 lines if doing huge recursion"""
# import threading
# threading.stack_size(1<<27)
# sys.setrecursionlimit(10000

def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    # Comment code out when you don't need inverse factorial or vice versa
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

    ifact = [0] * 200005
    ifact[200004] = pow(fact[200004], mod - 2, mod)
    for i in range(200004, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod

    return fact, ifact

def modinv(n, p):
    """ returns N inverse modulo p """
    return pow(n, p - 2, p)

def ncr(n, r,  fact, ifact):
    """ takes 4 arguments: n , r and factorial and inverse factorial lists"""
    t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD
    return t


def get_n(Sum):    
    """this function returns the maximum n for which Summation(n) <= Sum"""
    ans = (-1 + sqrt(1 + 8*Sum))//2
    return ans

def sieve(n):
    """ returns a list of prime numbers till n """
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r



def divs(n, start=1):
    """ returns a list of all divisors till n """
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors



def divn(n, primes):
    """ returns the number of divisors, two arguments n and the sieve till n """
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t



def lrfind(d, x, default=-1):
    """ Takes 2 arguments an iterable and an element. returns a tuple (firstoccurence,lastoccurence) -1 if not found """
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return default, default
    else:
        return left, right

def gcd(x, y): # math.gcd is slower
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def check_sorted(a):
    ''' returns True/False '''
    for i in range(len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
def ceil(n, k=1): return n // k + (n % k != 0) #returns math.ceil but protecting against floating inconsistencies
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) #inputs integer
def mi(): return map(int, input().split()) # inputting space seperated variables for example x,y,z
def li(): return list(map(int, input().split())) #inputting a space seperated list of integers
def lw(): return input().split() #inputting a space seperated list of strings
def lcm(a, b): return abs(a * b) // gcd(a, b) #returns LCM of two arguments
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) #For printing an iterable with seperator sep as optional second argument (default : " "), ending character (default: "\n") as optional third
def dd(): return defaultdict(int) #returns a dictionary with values defaulted to 0
def ddl(): return defaultdict(list) #returns a dictionary with values defaulted to []
def write(s): return sys.stdout.write(s)












###################################################################
def main():
    #CODE GOES HERE:
    x,y=mi()
    if (y%2!=0):
        print("No")
        return
    if (y//2<x):
        print("No")
        return
    if (y/2==x):
        print("Yes")
        return
    
    if(y/4 >x):
        print("No")
        return

    if(y/4==x):
        print("Yes")
        return
    print("Yes")

        











































""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

""" main function"""

if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ONE TRUTH PREVAILS
import sys
A,B=map(int,input().split())
if(B%2!=0):
    print("No")
    exit()
y=B-(2*A)
if y%2 or y<0:
    print("No")
    exit()
y=y//2
x=A-y
if x<0:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    if 4*x<y or y%2!=0:
        print('No')
        exit()
    for i in range(x+1):
        if 4*i+2*(x-i)==y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
c = (4.0*x-y) / 2.0
t = (y-2.0*x) / 2.0

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

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

if y/2-x <0 or 2*x-y/2<0:
  print("No")
  sys.exit()
if y//2!=y/2 :
  print("No")
  sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
import math
def ip():return int(input())
def imp():return map(int,input().split())
def impstr():return map(str,input().split())
def limp():return list(map(int,input().split()))
def limpstr():return list(map(str,input().split()))

a,b=imp()
for i in range(0,a+1):
    if i*2+(a-i)*4==b:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

flg = True

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
F = True
for turu in range(0,101):
    for kame in range(0, 101):
        if turu + kame == x and 2*turu + 4*kame == y:
            print('Yes')
            F = False
            
if F:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Y = y - 2*x
yy = Y % 2
X = 4*x - y
xx = X % 2

if yy == 0 and xx == 0 and Y >= 0 and X >= 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

        if (kame + turu) == y:
            print("Yes")
            exit(0)

    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
if x*4 < y:
    print('No')
elif x*2 > y:
    print('No')
elif 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):
  j = X - i
  
  if(((i * 2) + (j * 4)) == Y):
    print("Yes")
    exit()

print("No")

Submission status: Accepted

Solution code:
# coding: utf-8

############################

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

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

    if kame*2 + turu*4 ==y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

def func(x,y):
    if y % 2 == 1:
        return False
    if 4*x < y:
        return False
    if y < 2*x:
        return False
    else:
        return True
    
if func(x,y):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


bm = Y%2
b = Y/2-X
a = X - b
if bm == 0 and a >= 0 and b >= 0:
    print('Yes')
    exit(0)

print('No')

Submission status: Accepted

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

x1 = x
while x1 >= 0:
    if x1*4 + (x-x1)*2 == y:
        ans = "Yes"
        break
    x1 -= 1
print(ans)

Submission status: Accepted

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

#print(2*X-Y/2)
#print(Y/2-X)

if (2*X-Y/2).is_integer() and (Y/2-X).is_integer() 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())
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()
print('No')
# print('Yes' if y%2 == 0 and x >= y//2 and  y // 4 - (y%4) //2 <= x else 'No')

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

Submission status: Accepted

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

Submission status: Accepted

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

a = []

for i in range(x+1):
    s = i*2 + (x-i)*4
    t = i*4 + (x-i)*2
    a.append(s)
    a.append(t)
    
if y in a:
    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 (2*i+4*j)==y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

l = input().rstrip().split(" ")
X = int(l[0])
Y = int(l[1])

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
for turu in range(0,101):
  for kame in range(0,101):
    if turu + kame == x and 2 * turu + 4 * kame == y:
      print('Yes')
      exit()
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 a%2 == 0 and b >= 0 and b%2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

num = [[i,X - i] for i in range(0,X + 1)]

ans = "No"

for i in num:
  if i[0] * 2 + i[1] * 4 == Y:
    ans = "Yes"
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if Y%2 == 1:
    print("No")

elif 2*X <= Y and Y <= 4*X:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
line = list(map(int,input().split()))
if line[0]*4<line[1]:
    print("No")
elif line[0]*2>line[1]:
    print("No")
elif line[1]%2==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

combi = [(i, x-i) for i in range(x+1)]

for tsuru, kame in combi:
    if tsuru*2 + kame*4 == y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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

for a in range(101):
    if 2*a + 4*(x-a) == y and x - a >= 0:
        print("Yes")
        exit()
else:
    print("No")

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if(y%2==0 and 0<=y//2-x<=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/2 >= 0 and -X + Y/2 >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

check = 0

for num in range(0, x+1):
    if 2*num + 4*(x-num) == y:
        check = 1
        break

if check == 1:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

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

Submission status: Accepted

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

eva=False

if Y%2==0:
    if 4*X>=Y:
        if (2*X-Y/2)<=X:
            eva=True
if eva:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#import numpy as np
#import math
#from fractions import gcd

def main():

    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")

    X = first_input[0]
    Y = first_input[1]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

tf = False
if X == 1:
    if Y == 2 or Y == 4:
        tf = True
else:
    for i in range(0, X + 1):
        if i * 2 + (X - i) * 4 == Y:
            tf = True

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

Submission status: Accepted

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

ans = "No"

for bird in range(X + 1):
    turtle = X - bird
    if bird * 2 + turtle * 4 == Y:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input().split(" "))
animal = int(a[0])
foot = int(a[1])
 
saisyo = 2 * animal
saidai = 4 * animal
 
if (foot % 2 == 0) and (saisyo <= foot <= saidai):
	print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
x, y = map(int, input().split())
if x == 1 and(y == 2 or y == 4):
    print('Yes')
    exit()
for i in range(x+1):
    tmp = 2*(x-i)+i*4
    if tmp == y:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
X, Y = list(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:
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

X,Y=nm()
b_2=Y-2*X
a_2=4*X-Y

if(0<=b_2 and b_2%2==0 and 0<=a_2 and a_2%2==0):
    print('Yes')
    sys.exit(0)

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

if Y%2 == 1:
  print('No')
  exit()
  
if Y//2 < X:
  print('No')
  exit()
  
if 2*X < Y//2:
  print('No')
  exit()
  
print('Yes')