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
x,y = map(int,input().split())
for i in range(x+1):
    for j in range(x+1-i):
        if x==(i+j) and y == (2*i+4*j):
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

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


a=(4*x-y)/2

if (a//1==a/1 and 0<=a<=x):
    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")
        exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
def main():
    x, y = map(int, input().split())
    count = 2 * x
    if count == y:
        print('Yes')
        sys.exit()
    for i in range(x):
        count += 2
        if count == y:
            print('Yes')
            sys.exit()
    print('No')



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math


def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))

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

Submission status: Accepted

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

hit=False
for n in range(X+1):
    if 2*n+4*(X-n)==Y:
        hit=True
        break

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

def solve(X, Y):
    tmp = Y - 2 * X
    if tmp % 2:
        return False
    b = (Y - 2 * X) // 2

    tmp = 4 * X - Y
    if tmp % 2:
        return False
    a = (4 * X - Y) // 2

    if a >= 0 and b >= 0:
        return True
    else:
        return False

if solve(X, Y):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys
X, Y = map(int, sys.stdin.readline().rstrip().split())
a = (4 * X - Y) / 2
b = (Y - 2 * X) / 2
if a.is_integer() and b.is_integer() and a >= 0 and b >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

ans = "No";

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

  if((a + b) == Y):
    ans = "Yes"
    break

print(ans);

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

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

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

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
s = 0
flag = False

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

print("Yes" if flag == True 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:
import math

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

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

P=4*X-Y
Q=-2*X+Y
if (P%2==0) and (P>=0) and (Q%2==0) and (Q>=0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

#K = int(input())
#S = input()

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
#[[float("inf") for i in range(N)] for i in range(N)]

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    x, y = map(int, input().split())
    if y % 2 != 0:
        print('No')
    elif y // 2 - x < 0 or y > 4 * x:
        print('No')
    else:
        print('Yes')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
# debug = lambda *a, **kw: print(*a, **kw, file=sys.stderr)

x, y = inm()


def solve():
    if 4 * x - y < 0:
        return False
    if (4 * x - y) % 2 == 1:
        return False

    a = (4 * x - y) // 2
    return x - a >= 0


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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

for i in range(101):
    for j in range(101):
        if i + j == a:
            if i * 2 + j * 4 == b:
                print("Yes")
                exit()

print("No")

Submission status: Accepted

Solution code:
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    #n = int(stdin.readline().rstrip())
    x,y = map(int, stdin.readline().rstrip().split())
    #x = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    for b in range(x+1):
        a = x - b
        if 4 * b + 2*a == y:
            print("Yes")
            exit()
    print("No")

main()

Submission status: Accepted

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

Submission status: Accepted

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

t = (4 * X - Y) / 2
k = (-2 * X + Y) / 2

if (t % 1 == 0) and (k % 1 == 0) and (t >= 0 and k >= 0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def main():
    X,Y = map(int, input().split())
    # X=a+bかつY=2a+4bとなるようなa,bが存在するかどうか
    for a in range(X+1):
        b = X-a
        if Y==(2*a+4*b):
            print('Yes')
            return
    print('No')

main()

Submission status: Accepted

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

Submission status: Accepted

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

if  Y % 2 != 0 or (Y // 2) < X or 2 * X < (Y // 2):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    for i in range(x):
        if(2*i + 4*(x-i) == y or 2*(x-i) + 4*i == y):
            print("Yes")
            return
    print("No")
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    X,Y=map(int,input().split())
    y=0
    for i in range(X+1):
        if (Y-2*i)%4==0 and (Y-2*i)//4==X-i:
            y=1
            break
    if y==1:
        print("Yes")
    else:
        print("No")
    
    
    
if __name__=="__main__":
    main()

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:
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	x, y = LI()
	for turtle in range(x+1):
		turu = x - turtle
		if 4 * turtle + 2 * turu == y:
			print('Yes')
			break
	else:
		print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
p = x * 2
if p == y:
    print('Yes')
elif p > y:
    print('No')
else:
    for i in range(x+1)[1:]:
        p += 2
        if p == y:
            print('Yes')
            break
        elif p > y:
            print('No')
            break

if y > p:
    print('No')

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

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

print("No")

Submission status: Accepted

Solution code:

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

ans = "No"

if y%2==0 and x<=y//2 and y//2<=x*2:
  ans = "Yes"


print(ans)

Submission status: Accepted

Solution code:
def resolve():
    X, Y = [int(i) for i in input().split()]
    for i in range(0, X + 1):
        for j in range(0, X + 1):
            if i + j != X:
                continue
            if 2 * i + 4 * j == Y:
                print("Yes")
                return
    print("No")


resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

    if y / x > 4:
        print('No')
    elif y % 2 != 0:
        print('No')
    elif y / x < 2:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop
import bisect


"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""


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*X>=0 and (Y-2*X)%2==0 and 4*X-Y>=0 and (4*X-Y)%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in range(0, x+1):
    if i * 2 + (x - i) * 4 == y:
        print('Yes')
        exit(0)
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:
import sys
X, Y = map(int,input().split())
kame = 4
turu = 2

for i in range(0,X+1):
  nkame = i
  nturu = X-i
  ashi = nkame*kame + nturu*turu
  if ashi == Y:
    print("Yes")
    sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    tsuru = 0
    kame = 0

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

    print("No")



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B

X,Y=map(int,input().split())
if Y<2*X or 4*X<Y:
    print("No")
else:
    if (Y-2*X)%2!=0 or (4*X-Y)%2!=0:
            print("No")
    else:
        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")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys
input = sys.stdin.readline
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

x,y = ip()
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())

ans = False
for i in range(x*2,x*4+1,2):
    if i == y:
        ans = True
        break


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

Submission status: Accepted

Solution code:
x, y = list(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())
if y < x*2 or x*4 < y:
    print('No')
else:
    if (x*4-y) % 2 == 0:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = list(map(int, input().split()))
for i in range(1000):
    for j in range(1000):
        if i+j == x and 2*i+4*j == y:
            print('Yes')
            exit()
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 y//2-x>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in input().split()]
if Y % 2 != 0:
    print('No')
else:
    if 2 * X <= Y and 4 * X >= Y:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
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
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Submission status: Accepted

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

def solve():
    X, Y = map(int, readline().split())

    a = Y - X * 2

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

solve()

Submission status: Accepted

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

Submission status: Accepted

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

foot = 0
for i in range(x):
  foot += 4
  
ok = False
if foot == y:
  ok = True
for i in range(x):
  foot -= 2
  if foot == y:
    ok = True

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))


def main():
    x,y = na()
    if y%2:
        print('No')
        return
    y = y//2
    a,b = 2*x-y,y-x
    if a>=0 and b>=0:
        print('Yes')
    else:
        print('No')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    if (turu * 2 + kame * 4) == y:
        flag = True
        break

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

Submission status: Accepted

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

if 2*X <= Y and Y <= 4*X and Y % 2 != 1:
    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:
def main():
    x, y = map(int, input().split())

    res = 'No'

    for i in range(x+1):
        crane = i
        turtle = x - i

        if crane*2 + turtle*4 == y:
            res = 'Yes'
            break
    
    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    x,y = LI()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
c=0
z=y//2

for i in range(z+1):
    if i==2*x-y/2:
        c+=1
if c>0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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


def main():
    X, Y = map(int, readline().rstrip().split())
    for i in range(X + 1):
        j = X - i
        if 2 * i + 4 * j == Y or 2 * j + 4 * i == Y:
            print('Yes')
            return
    
    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
a = 0
flag = 1
while a <= 100:
    b = x-a
    if b >= 0 and 2*a + 4*b == y:
        print("Yes")
        flag = 0
        break
    a+=1
if flag:
    print("No")

Submission status: Accepted

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

    if y%2 :
        return "No"
        
    a = y-(2*x)
    if a%2 or a<0 :
        return "No"
    
    a = a//2
    if x-a < 0 :
        return "No"

    return "Yes"

print(solve())

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest


def resolve():
    # s = input()
    # n = int(input())
    x, y = map(int, input().split())
    # l = [list(map(int, input().split())) for _ in range(n)]

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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3 8"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2 100"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1 2"""
        output = """Yes"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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