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
#sys.exit()
#sorted( ,reverse=True)
#N = int(input())
X, Y = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]

#cnt = 0
#cnt += 1

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



#print(N)
#print(S,T)
#print(A)
#print('Yes')
print('No')
#print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

    for i in range(0, 101):
        for j in range(0, 101):
            if i + j == X and 2*i + 4*j == Y:
                print('Yes')
                exit()

    print('No')


if __name__ == "__main__":
    main()

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

a = 1/2 * (4 * X - Y)
b = 1/2 * (-2 * X + Y)

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

Submission status: Accepted

Solution code:
def LI(): return list(map(int, input().split()))
def I(): return map(int, input().split())
mod = 10**9 + 7

def main():
  x , y = I()
  for i in range(x+1):
    if 2 * i + 4 * (x-i) == y:
      print('Yes')
      exit()
    
  print('No')
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

Submission status: Accepted

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

if Y%2==1:
  print("No")
  exit()
  
if Y < 2*X or Y > 4*X:
  print("No")
  exit()
  
print("Yes")

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    X,Y=MI()
    flag=0
    for i in range(X+1):
        temp=2*i+(X-i)*4
        if temp==Y:
            flag=1
            break
        
    if flag==1:
        print("Yes")
    else:
        print("No")

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# # -*- coding: utf-8 -*-
X, Y = map(int, input().split(' '))

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


print('No')

Submission status: Accepted

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

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


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


print('No')

Submission status: Accepted

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

f = 0

for a in range(100):
    for b in range(100):
        x = a + b
        y = 2 * a + 4 * b
        if x == X and y == Y:
            f = 1
            break

    if f == 1:
        break

print(['No', 'Yes'][f])

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

ans='No'

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

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:
            if 2 * i + 4 * j == y:
                print('Yes')
                quit()
print('No')

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
for t in range(101):
    for k in range(101):
        if t + k != x:
            continue
        if y == t * 2 + k * 4:
            print('Yes')
            exit()

print("No")

Submission status: Accepted

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

for a in range(X + 1):
    b = X - a
    if b >= 0 and 2 * a + 4 * b == Y:
        ans = 'Yes'
        break
else:
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

    for crane in range(bodies + 1):
        turtle = bodies - crane
        if 2 * crane + 4 * turtle == legs:
            print('Yes')
            return
    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

for x in range(0, X+1):
    leg = 2*x + 4*(X-x)
    if Y == leg:
        print('Yes')
        exit()
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')
        break
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for t in range(51):
    for k in range(26):
        if t * 2 + k * 4 == Y and t + k == X:
            print("Yes")
            exit(0)

print("No")

Submission status: Accepted

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

j = 0
for a in range(100):
  for b in range(100):
    if((a+b == X)and(a*2+b*4 == Y)):
      j = 1
      break
     
if(j == 0):
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x,y = list(map(int,input().split()))
ret = "No"
for i in range(1,x+1):
    for j in range(i+1):
        if j * 2 + (x-j) * 4 == y:
            ret = "Yes"
            break

print(ret)

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

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

Submission status: Accepted

Solution code:
# babc170_b.py
X, Y = map(int,input().split())
for i in range(1000):
    for j in range(1000):
        if i+j==X and i*2 + j * 4==Y:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

if 2*a<=b and 4*a>=b and b%2==0:
  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:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    X, Y = [int(i) for i in input().strip().split()]
    for i in range(X + 1):
        if i * 2 + (X - i) * 4 == Y:
            return "Yes"
    return "No"


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
x, y  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

for n in range(x + 1):
    t = x - n
    k = n

    if 2 * t + 4 * k == y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

def check(x, y):
	for c in range(x + 1):
		t = x - c
		if c * 2 + t * 4 == y:
			return True
	return False

if check(x, y):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

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

t = 0
while t<=X:
  k = X-t
  if 2*t+4*k == Y:
    print('Yes')
    break
  if t==X:
    print('No')
    break
  t += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
from collections import defaultdict as dd
from collections import deque as dq
import itertools as it
from math import sqrt, log, log2
from fractions import Fraction

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

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

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

print('Yes')

Submission status: Accepted

Solution code:
X,Y = [int(i) for i in 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())
mi=2*x
ma=4*x
ans='No'
if y%2==0 and y>=mi and y<=ma:
    ans='Yes'
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

def main():
    X, Y = map(int, readline().split())
    for x in range(X+1):
        for y in range(Y+1):
            if x*2 + y*4 == Y and x + y ==X:
                print('Yes')
                return
    print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())


# for _ in range(ii()):
    
x,y=mi()
f=0
if(2*x<=y<=4*x):
    if(y%2==0):
        f=1
if(f):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X,Y = (int(x) for x in input().split())
for a in range(X+1):
    if 2 * a + 4 * (X-a) == Y:
        print('Yes')
        break
else:
    print('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
print("Yes" if flag else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if y%2==0 and y//2-x>=0 and 2*x-y//2>=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 i*2+(x-i)*4 == y:
    ans = 'Yes'
    break
print(ans)

Submission status: Accepted

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

for i in range(101):
    for j in range(101):
        if i + j == x and 2*i + 4*j == y:
            flag = True

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

Submission status: Accepted

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

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf
# @pysnooper.snoop()
#import pysnooper # debug

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect

def solve(animals, legs):
    if legs % 2 != 0:
        return False
    min_ = animals * 2
    max_ = animals * 4
    if min_ <= legs <= max_:
        return True
    else:
        return False

if __name__ == '__main__':
    animals, legs = list(map(int, input().split()))
    ans = solve(animals, legs)
    if ans:
        print("Yes")
    else:
        print("No")

    #print('\33[32m' + 'end' + '\033[0m') # debug

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def _ia(): return map(int, sys.stdin.readline().strip().split())


def main():
    x, y = _ia()
    if y % 2 == 0 and (2*x <= y <= 4*x):
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import print_function
import sys


if sys.subversion[0] == "PyPy":
    import io, atexit

    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())
RN = lambda x=int: x(RS())


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




x, y = RA()
solve()

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:

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

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

a, b = map(int, input().split())
flag = "No"

for x in range(a + 1):
    for y in range(a + 1):
        if x + y == a and 2 * x + 4 * y == b:
            flag = "Yes"
            break

print(flag)

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

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7

x, y = MAP()

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

Submission status: Accepted

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

import sys

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

Submission status: Accepted

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

m = 2*x
M = 4*x

if m <= y <= M and y%2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    x, y = MII()
    for i in range(x+1):
        if 4*i + 2*(x-i) == y:
            print('Yes')
            exit()
    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
if b%2==1:
  print("No")
  sys.exit()
if 2*a<=b<=4*a:
  print("Yes")
else:
  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())

ok = False
for a in range(0, x + 1):
    b = x - a
    if b < 0:
        continue

    if 2 * a + 4 * b == y:
        ok = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

X, Y = LI()

ans = True
if Y % 2 == 1:
    ans = False

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



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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(10000):
    y = X-x
    if y < 0:
        continue
    z = x*2+4*y
    if z == Y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False
# show_flg = True


def main():
    X, Y = MI()
    ans = 0

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

    print(yn[ans >= 1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
maxX = X * 4
minX = X * 2
if Y %2 == 0 and minX <= Y <= maxX:
    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:
def LI():return list(map(int,input().split()))
def MI():return map(int,open(0).read().split())
def I():return int(input())
def yes():print("Yes")
def no():print("No")

from collections import deque, Counter
from heapq import heappop, heappush
INF=float("inf")
# import math
# pi=math.pi

# import numpy as np
x,y=LI()

for a in range(0,x+1):
    b=x-a
    if b>=0 and 2*a+4*b==y:
        yes()
        exit()
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())
ttt=0
for i in range(0, x+1):
  if i*2+(x-i)*4==y:
    ttt=1
    print("Yes")
    break
if ttt==0:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

x,y = na()

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import sys
import itertools
from math import gcd
from math import sqrt
from sys import stdin
def input() : return stdin.readline().rstrip()
def mips():
    return map(int,input().split())
def ii():
    return int(input())
sys.setrecursionlimit(10**9)

X,Y = mips()
#X = tsuru + kame
#Y = 2 * tsuru + 4 * kame
for t in range(0,100):
    kame = X-t
    if kame < 0:
        break
    if 2 * t + 4 * kame == Y:
        print("Yes")
        sys.exit(0)
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()
print("No")

Submission status: Accepted

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