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:
import sys


def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


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


def main():
    x, y = tuple(input_ints())
    # t + k == x
    # 2t + 4k == y

    r = False
    for t in range(x+1):
        k = x - t
        if 2 * t + 4 * k == y:
            r = True
            break

    print("Yes" if r else "No")

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X, Y = map(int, input().split())
    remain = Y - 2 * X
    ans = True
    if remain < 0:
        ans = False
    if remain % 2 != 0:
        ans = False
    if remain//2 > X:
        ans = False
    print('Yes' if ans else 'No')

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

print('No')

Submission status: Accepted

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

    for n_cranes in range(X+1):
        n_turtles = X - n_cranes

        if n_cranes * 4 + n_turtles * 2 == Y:
            return 'Yes'

    return 'No'


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
head, leg = [int(idx) for idx in input().split()]
crane = 2
turtle = 4
for idx in range(0,head+1):
  ans1 = 0
  ans2 = 0
  ans1 = crane*idx
  ans2 = turtle*(head-idx)
  if ans1 + ans2 == leg:
    print('Yes')
    break
  elif idx == head:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

YES = "Yes"  
NO = "No" 

for i in range(X+1):
    two = i
    four = X-i
    
    if 2 * two + 4 * four == Y:
        print(YES)
        sys.exit()

print(NO)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
Flag = False
for i in range(X+1):
    if i * 2 + 4 * (X - i) == Y:
        Flag = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = [int(x) for x in input().split()]
ans = 0
for i in range(x+1):
  c,t = i,x-i
  ans += (2*c+4*t == y)

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

Submission status: Accepted

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

x = (4*b[0] - b[1])/2
y = (b[1] - 2*b[0])/2
if x >= 0 and y >= 0 and (x - int(x)) == 0 and (y - int(y)) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
N, Y = map(int, input().split())
 
for i in range(N + 1):
  
  j = N -i
  x = (4 * i) + (2 * j)
  if x == Y:
    print("Yes")
    sys.exit()
      
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())
kame=(y//2)-x
if y%2!=0:
    print("No")
elif (kame>=0)&(kame<=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/2 == a//2 and a >= 0 and b/2 == b//2 and b >= 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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'
    break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print("Yes" if exist else "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:
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 = map(int, input().split())

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if Y>=2*X 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):
  a=2*i+4*(x-i)
  if a==y:
    print("Yes")
    exit()
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:
#Crane and Turtle
X, Y = list(map(int,input().split()))

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

print(flag)

Submission status: Accepted

Solution code:
x,y=map(int,input().split()) # 動物の総数ｘ足の総数ｙ本

ans="No"

for a in range(x+1):
    b=x-a
    if 2*a+4*b==y: # aは鶴　bは亀　
        ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
#coding:utf-8

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

t = 0.5 * Y - X

c = 2 * X - 0.5 * Y

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

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in input().split()]
check = True
if X*4 < Y:
    print('No')
elif Y < 2*X:
    print('No')
elif Y%2==1:
    print('No')

else:
    print('Yes')

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in input().split()]
check = True
if X*4 < Y:
    check = False
elif Y < 2*X:
    check = False
elif Y%2==1:
    check = False

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    for a in range(X + 1):
        for b in range(X + 1 - a):
            if 2*a + 4*b == Y and a + b == X:
                print('Yes')
                exit()
            else:
                pass

    print('No')

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
x,y=map(int,stdin.readline().split())
poss=True
if(y%2==1):
    poss=False
elif(y<2*x):
    poss=False
elif(y>4*x):
    poss=False
if(poss):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
hiki,hon = map(int,input().split())
turu = 0
kame = 0

for i in range(50):
    if hiki > 0 and hon >= 4:
        hon = hon - 4
        kame = kame + 1
        hiki = hiki - 1
    elif hon == 2 and hiki == 1:
        hiki = 0
        hon = 0
    else:
        break

hantei = hon % 2

for i in range(50):
    if hiki == 0 or kame == 0 or hantei == 1:
        break
    elif hiki > 0 and kame > 0 and hantei == 0:
        hiki = hiki - 1
        kame = kame - 1

if hiki == 0 and hon == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    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)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
Input = input().split()
X = Input[0]
X = int(X)
Y = Input[1]
Y = int(Y)

A = 0
for i in range(X+1):
    C = i
    T = X - C
    CL = C * 2
    TL = T * 4
    L = CL + TL
    if L == Y:
        A += 1

if A == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
kame=Y/2-X
turu=-Y/2+2*X

if kame<0 or turu<0:
    ans='No'
elif kame.is_integer() and turu.is_integer():
    ans='Yes'
else:
    ans='No'
print(ans)

Submission status: Accepted

Solution code:
import sys
from functools import reduce


def input():
    return sys.stdin.readline()[:-1]

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

bool1 = Y - 2*X >= 0
bool2 = 4*X - Y >= 0

if bool1 and bool2 and Y % 2 == 0:
    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 (2 * i + 4 * (x - i)) == y:
    print("Yes")
    flag = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
animals, legs = [int(x) for x in input().split()]
flg = False

for i in range(animals + 1):
    j = animals - i
    if 2 * i + 4 * j == legs:
        flg = True

print("Yes" if flg else "No")

Submission status: Accepted

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

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

if a < 0:
  print('No')
elif a % 2 != 0:
  print('No')
elif b < 0:
  print('No')
elif b % 2 != 0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
s = input().split()
num = int(s[0])
total = int(s[1])
max_num = total//2 #全部２だった時のnumの最大値
tmp = max_num//2 #numを２で割った時の商、tmp回はmax_numから引ける
min_num = max_num - tmp
if total%2 ==1:
    print("No")
elif num <= max_num and min_num <= num:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
result = 'No'
for i in range(100):
    for j in range(100):
        if (i+j==x) and (i*2+j*4 == y):
            result = 'Yes'
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
max_kame = int(y/4)
for kame in range(max_kame,-1,-1):
  turu = x - kame
  sum_leg = 2 * turu + 4 * kame
  if sum_leg == y:
    print('Yes')
    break
  if kame == 0:
    print('No')
    break

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=1
for i in range(0,b):
  for j in range(0,b):
   if i+j==a and i*2+4*j==b:
    ans+=1
    break
   else:
     pass

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

Submission status: Accepted

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

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
def run(x, y):
    '''
    '''
    for i in range(x + 1): # turtle
        if y == 2 * i + 4 * (x - i):
            print('Yes')
            return
    print('No')



if __name__ == '__main__':
    x, y = list(map(int, input().split()))
    run(x, y)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
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())
legs, i = 4*x, 0
while y<legs and i<x: legs-=2; i+=1
if legs==y: print('Yes')
else: print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
"""
    Satwik_Tiwari ;) .
    16 june , 2020  - Tuesday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase


import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    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(b"\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()

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


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        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")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    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()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

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



testcase(1)
# testcase(int(inp()))

Submission status: Accepted

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

Submission status: Accepted

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

max_leg = 4 * X
min_leg = 2 * X

if min_leg <= Y <= max_leg and Y % 2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
[X, Y] = list(map(int, input().split()))
tsuru = 4 * X - Y
kame = Y -2 * X
if (tsuru >= 0) and (tsuru % 2 == 0):
  if (kame >= 0) and (kame % 2 == 0):
    ans = 'Yes'
  else:
    ans = 'No'
else:
  ans = 'No'

print(ans)

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(0)
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def turtle(x, y):
    tmp = y - 2 * x
    if tmp >= 0 and tmp % 2 == 0:
        return True
    else:
        return False


def crane(x, y):
    tmp = 4 * x - y
    if tmp >= 0 and tmp % 2 == 0:
        return True
    else:
        return False


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

if turtle(x, y) and crane(x, y):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#import math
#=input()
#=int(input())
x,y=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

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

Submission status: Accepted

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

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

if (float.is_integer(a)) & (float.is_integer(b)) & (a>=0) & (b>=0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
li = list(map(int, input().split()))
re = "Yes"
if li[0] * 4 < li[1]:
  re = "No"
elif li[0] * 2 > li [1]:
  re = "No"
elif li[1] % 2 != 0:
  re = "No"
print(re)

Submission status: Accepted

Solution code:
S,leg = [int(i) for i in input().split()]
#2x + 4(S-x) = leg
#2x + 4S - 4x - leg = 0
#2x = 4S-leg
x = (4*S-leg)/2
if x-int(x) == 0 and x>=0 and x <= S:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

def solve(X, Y):
    for k in range(X+1):
        t = X - k
        if k * 2 + t * 4 == Y:
            return "Yes"
    return "No"

print(solve(X, Y))

Submission status: Accepted

Solution code:
X,Y=map(int,input().split());print("YNeos"[((y:=Y/2)-X)*(2*X-y)!=abs(int((y-X)*(2*X-y)))::2])

Submission status: Accepted

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

a = x[0]*2 - x[1]/2
b = -x[0] + x[1]/2

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
 
Y = (B - 2*A) / 2
 
if not( Y.is_integer() ) or ( Y < 0) :
    print('No')
    exit(0)
else:
    X = A - Y
    if X < 0:
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 20 15:37:51 2020

@author: naoki
"""
import sys

X,Y = map(int, input().split()) # input values of X and Y 
i = 0 
if Y % 2 == 1 or Y > 4*X or Y < 2 * X:
    print("No") # it is impossible if the number of legs is not even or is over 4X or fewer 4Y.
    sys.exit()
else:
    while 4*i <= Y and i<= X:
        if 4*i + 2*(X-i) == Y:
            print("Yes")
            sys.exit()
        else:
            i+=1
print("No")

Submission status: Accepted

Solution code:

#x+y = A
#2x+4y = B

A,B = map(int,input().split())

Y = (B - 2*A) / 2

if not( Y.is_integer() ) or ( Y < 0) :
    print('No')
    exit(0)
else:
    X = A - Y
    if X < 0:
        print('No')
        exit(0)

print('Yes')

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

upto = 4 * X

if upto == Y:
    print("Yes")
    exit()
while X:
    upto -= 2
    if Y == upto:
        print("Yes")
        exit()
    X -= 1
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(n+1):
    f = 2 * i + 4 * (n - i)
    if f == m:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
def ip():
    return [ int(_) for _ in input().split()]

def main():
    ip1=ip()
    two=ip1[1]-ip1[0]*2
    if (two&1 or two<0):
        print("No")
        return
    four=ip1[0]*4-ip1[1]
    if (four&1 or four<0):
        print("No")
        return
    print("Yes")
    





if __name__=='__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
a, b = map(int, sys.stdin.buffer.read().split())
if not b % 2 and (a * 2 <= b <= a * 4):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
okay = False
for a in range(101):
  for b in range(101):
    if (a + b == x) and (2 * a + 4 * b == y):
      if not okay:
      	print('Yes')
      okay = True
if not okay:
  print('No')

Submission status: Accepted

Solution code:
import argparse
import collections
import logging.config
import sys
import csv
import numpy as np

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

def main():
    s=input().split(" ")
    si = []
    for d in s:
        si.append(int(d))
    print (tester(si[0],si[1]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
  x,y=map(int,input().split())
  k=y-2*x
  if (k&1 or k<0): 
    print("No")
    return
  j=4*x-y
  if(j&1 or j<0):
    print("No")
    return
  print("Yes")
  
solve()

Submission status: Accepted

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

ans = 'No'
for i in range(X + 1):
    bird = i
    turt = X - i

    if 2 * bird + 4 * turt == Y:
        ans = 'Yes'

print(ans)

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

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

if __name__ == "__main__":
  run()

Submission status: Accepted

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

flg = False

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
print(['No', 'Yes'][y in [2*x+2*t for t in range(x+1)]])

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
k = 0  # k is number of torts
flag = False
for k in range(y//4+1):
    tot = (4*k)+(2*(x-k))
    if tot == y:
        flag = True
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

X,Y = map(int,readline().rstrip().split())
for c in range(X+1):
    t = X-c
    sum = 2*c+4*t
    if sum == Y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import sys

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

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

print("No")