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())
T = Y/2-X
B=2*X-Y/2
if Y/2 != Y//2:
    print("No")
elif T>=0 and B>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

if l%2 != 0:
    print('No')
elif l < 2*n:
    print('No')
else:
    if l/n <= 4:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
list = []
ans = 0
for i in range(x) :
    list.append(4)

if sum(list) == y:
    print('Yes')
    ans = 1

else :
    for i in range(x) :
        list.remove(4)
        list.append(2)
        if sum(list) == y:
            print('Yes')
            ans = 1
            break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in 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):
    r = i*2 + (x-i)*4
    if r == y:
        print("Yes") 
        exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Crane and Turtle
import numpy as np
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
X, Y = map(int, input().split())    
mat = np.array([[2,-0.5],[-1,0.5]])
matb = np.array([[X], [Y]])
Ans = np.dot(mat, matb)
if (is_integer(Ans[0]) is True) and (is_integer(Ans[1]) is True):
    if (Ans[0] >= 0) and (Ans[1] >= 0):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(X,Y):
  if Y % 2 == 1:
    return False
  if X * 4 < Y:
    return False
  c_legs, t_legs= 2, 4
  for c in range(X + 1):
    legs = c * c_legs + (X - c) * t_legs
    if legs == Y:
      return True
  return False

X, Y = map(int, input().split())
ans = "Yes" if solve(X,Y) else "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(X+1):
    A = 4*x + (X-x)*2
    if A==Y:
        flg = 1
        break

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


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


def z():
    return int(input())


def S():
    return input()


def C(line):
    return [input() for _ in range(line)]


def get_ashi(x, y):
    return 2*x + 4*y


x, y = zz()
turu = x
kame = 0
while (get_ashi(turu, kame) != y):
    if (turu == 0):
        print('No')
        exit()
    turu -= 1
    kame += 1
print('Yes')

Submission status: Accepted

Solution code:
values = input().split()

num_animals = int(values[0])
num_legs = int(values[1])

max_possible_legs = num_animals*4
min_possible_legs = num_animals*2

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

elif (num_legs <= max_possible_legs) and (num_legs >= min_possible_legs):
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

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

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X, Y = MII_split()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if min(foot_num) <= Y and max(foot_num) >= Y:
    print('Yes' if Y % 2 == 0 else 'No')
    
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

readline = sys.stdin.readline

def proc():
    k,n = map(int,readline().rstrip().split())
    #2x + 4y = n
    p,q = -1,-1
    ans = []
    #print(k,n, "**")
    for i in range(0, 101):
        for j in range(0,101):
            #print(i,j,"***")
            if 2*i + 4*j == n:
                p,q = i,j
                ans.append( (p,q))

    for pair in ans:
        p,q = pair[0],pair[1]
        if p+q == k:
            return "Yes"
    
    return "No"



#for _ in range(int(readline())):
print(proc())

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    a = {2*i + 4*(x-i) for i in range(x+1)}
    print('Yes') if y in a else print('No')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    x, y = map(int, input().split())
    a = [ 2*i + 4*(x-i) for i in range(x+1)]
    print('Yes') if y in a else print('No')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
for turtle in range(X+1):
    leg_num = turtle * 4 + (X-turtle) * 2
    if Y == leg_num:
        print('Yes')
        quit()
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"
    break
    
print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=input().split()
X=int(X)
Y=int(Y)
a=(Y-2*X)*5 
b=(4*X-Y)*5 
a1=a%10
b1=b%10
if a>=0 and b>=0:
  if a1==0 and b1==0:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C + T = X
# 2 * C + 4 * T = Y
# T = X - C
# 2 * C + 4 * (X - C) = Y
# - 2 * C = Y - 4 * X
# C = 2 * X - Y // 2
# T = -X + Y // 2


def main():
    X, Y = map(int, input().split())
    C = 2 * X - Y // 2
    T = -X + Y // 2
    print("Yes" if 0 <= C and 0 <= T and C + T ==
          X and 2 * C + 4 * T == Y else "No")
    return


main()

Submission status: Accepted

Solution code:
def main():
    n, legs = [int(x) for x in input().split(" ")]

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

    max = legs / 2
    min = int(legs / 4) + (legs % 4) / 2

    print("Yes" if n >= min and n <= max else "No")

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import time
st = time.perf_counter()
# ------------------------------

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

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
X,Y=MI()

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

if Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

import os
import sys


# atcoder.main
# Date: 2020/06/18
# Filename: main 
# Author: acto_mini

def main():
    X, Y = map(int, input().split())

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
tmp_xy = input().split()
x = int(tmp_xy[0])
y = int(tmp_xy[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m  = map(int,input().split())
if m%2==1 or m//2<n or m//2-n>n:
    print('No')
    exit()
print('Yes')

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 y<2*x or 4*x<y:
    print("No")

else:
    if y%2!=0:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

ans = 'No'

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
	X, Y = map(int, input().split())
	if Y % 2 != 0:
		return "No"
	turtle = (Y // 2) - X
	if turtle < 0:
		return "No"
	crane = X - turtle
	if crane < 0:
		return "No"
	if crane + turtle == X and 2 * crane + 4 * turtle == Y:
		return "Yes"
	return "No"


def main():
	print(solve())


if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
kazu, ashi = map(int, input().split())

kame, tsuru, hantei = 0, 0, 0

for i in range(kazu+1):
    kame = i
    tsuru = kazu - i
    if kame * 4 + tsuru * 2 == ashi:
        hantei = 1
        break

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

Submission status: Accepted

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

for i in range(0, X+1):
  kame = 2 * i
  ashi = Y - kame
  if ashi % 4 == 0:
    if ashi // 4 == X-i:
      print("Yes")
      exit()

print("No")

Submission status: Accepted

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

for i in range(x+1):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  if(y%2==0 and y/2==x):
    judge='Yes'
  for j in range(x+1-i):
    if((i*2+j*4)==y and i+j==x):
      judge='Yes'
    if((i*4+j*2)==y and i+j==x):
      judge='Yes'
      
if(y%2==1):
  judge='No'

print(judge)

Submission status: Accepted

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

def main():
    if 0<=(y/2 -x)<=x:
        if y==0 or x==0:
            return 'No'
        if (y/2 -x)%1==0:
            return('Yes')
        else:
            return('No')
    else:
        return('No')
print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
kazu, ashi = map(int, input().split())
tsuru, kame = 0, 0
hantei = 0

for i in range(kazu+1):
    kame = i
    tsuru = kazu - i
    if kame * 4+ tsuru * 2 == ashi:
        hantei = 1
        break

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

Submission status: Accepted

Solution code:
input = input()
 
nums = input.split(" ")
 
animals = int(nums[0])
legs = int(nums[1])
 
turu = (4*animals -legs)/2.0
kame = (legs-2*animals)/2.0
 
if turu.is_integer() and kame.is_integer() and turu>=0 and kame>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
input = input()

nums = input.split(" ")

animals = int(nums[0])
legs = int(nums[1])

turu = (4*animals -legs)/2.0
kame = (legs-2*animals)/2.0

if turu.is_integer() and kame.is_integer() and turu>=0 and kame>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import Fraction

a=input()
a=a.split()

X=int(a[0])
Y=int(a[1])

x=Fraction(4*X-Y,2)
y=Fraction(Y-2*X,2)

if x-round(x)==0 and x >= 0:
  if y-round(y)==0 and y >= 0:
    print("Yes")
  else :
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
flag = False
for i in range(x + 1):
    j = x - i
    if i * 2 + j * 4 == y:
        flag = True
if flag:
    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:
import sys

def Y_N(a,b):
    for i in range(a+1):
        if 2 * (a-i) + 4 * i == b:
            return "Yes"
    return "No"

if __name__ == '__main__':
  input = sys.stdin.readline

  s = input().rstrip()

  ar = list(map(int,s.split()))
  
  print(Y_N(ar[0],ar[1]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if x * 4 < y or x * 2 > y:
    print("No")


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

Submission status: Accepted

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

if n >=0 and m >=0:

    if n == int(n) and m == int(m):
      print("Yes")
    else:
      print("No")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
import sys

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

if X * 4 < Y or X * 2 > Y:
    print("No")
    sys.exit()

while (1):
    if Y % 4 == 0:
        Y = Y - 4
    elif Y % 2 == 0:
        Y = Y - 2
    else:
        print("No")
        break

    if Y == 0:
        print("Yes")
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if x*4<y:
    print("No")

elif y/2<x:
    print ("No")

elif y % 2 == 0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

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:
#!/usr/bin/env python3

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

# a+b = x
# 2*a+4*b = y

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


if a < 0 or b < 0:
    print("No")
    exit()
if a == 0 and b == 0:
    print("No")
    exit()
if a+b != x or 2*a+4*b != y:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n=int(input())
x,y=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
flag=False
for i in range(x+1):
    j=x-i
    foot=i*2+j*4
    if foot==y:
        flag=True
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
      
C=2
T=4
B=(4*X)
A=Y%2
end=False
tiny=False
D=(Y/2)

if D<X:
      print("No")
      tiny=True
if Y > B and tiny == False:
      print("No")
      end=True
      
if end==False and A == 0 and tiny == False:
      print("Yes")
if end==False and A !=0 and tiny == False:
      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:
import sys
i = 0
x, y = input().split()
x, y =  int(x), int(y)

for count in range(0, x):
    i += 4

for count in range(0, x):
    if i > y:
        i -= 2

    if i == y:
        print("Yes")
        sys.exit()

print("No")

Submission status: Accepted

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


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

Submission status: Accepted

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

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

if(y < 2*x):
    print("No")
    exit(0)

if(y > x * 4):
    print("No")
    exit(0)

print("Yes")

Submission status: Accepted

Solution code:
def solve(x,y):
    if y%2==0 and x*2 <= y <= x*4:
        return 'Yes'
    else:
        return 'No'
    

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

#x, y = 51, 100
#b = (y - 2 * x) // 2
#a = x - b
#print(a, b)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if (Y-2*X >= 0 and (Y-2*X)%2==0) and X-((Y-2*X)/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):
    total = 2 * i + 4 * (X - i)
    if total == Y:
        flag = 1
        break
if flag == 1:
    print("Yes")
else: 
    print("No")

Submission status: Accepted

Solution code:
X,Y= map(int,input().split())
b=(Y-2*X)%2
a=(4*X-Y)%2
B=(Y-2*X)/2
A=(4*X-Y)/2
if (b==0 and a==0 and A>=0 and B>=0):
    print('Yes')
else:
    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')
    quit()
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 = map(int, input().split())
b = Y & 1 == 0 and X <= Y >> 1 <= X << 1
ans = "Yes" if b else "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
t = max(0, (y - 2*x)//2)
c = max(0, x - t)
if 4*t + 2*c == y:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

printed = False
for i in range(X + 1):
    a = i * 2
    b = (X - i) * 4

    if a + b == Y:
        print("Yes")
        printed = True
        break

if not printed:
    print("No")

Submission status: Accepted

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

# a + b = x
# 2a + 4b = y

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

if 0<=a and 0<=b and 2*a + 4*b == y:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
import math
#import random
#sys.setrecursionlimit(1000000)
input = sys.stdin.readline
 
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input()))
def inara():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))
################################################################
############ ---- THE ACTUAL CODE STARTS BELOW ---- ############

x,y=invr()

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

print("No")