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:
#!/usr/bin/env python
#pyrival orz
import os
import sys
from io import BytesIO, IOBase

"""
    for _ in range(int(input())):
    n,m=map(int,input().split())
    n=int(input())
    a = [int(x) for x in input().split()]
"""

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

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

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

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

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


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
~~ Author : Bhaskar
~~ Dated : 07~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi,log
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")

def solve():
    a,b = map(int,sys.stdin.readline().split())
    ok = False
    for i in range(0,101):
        for j in range(0,101):
            if i + j == a and 2*i+4*j == b:
                ok = True
                break
    if ok:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    # try:
    #     sys.stdin = open("input.txt","r")
    # except :
    #     pass
    solve()



"""

2*x + 4*y = b


"""

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def actual(x, y):
    for i in range(x + 1):
        crane, turtle = i, x - i

        legs = 2 * crane + 4 * turtle

        if legs == y:
            return 'Yes'

    return 'No'

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def resolve():
    import sys
    input = sys.stdin.readline
    xy = [int(x) for x in input().rstrip().split()]
    x = xy[0]
    y = xy[1]
    
    for i in range(x+1):
        if((i * 2 + (x-i)*4) == y):
            print("Yes")
            exit()
    
    print("No")


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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


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


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


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
co = 0
for n in range(x+1):
    a = n*2 + (x-n)*4
    if a == y:
        co = co + 1


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

Submission status: Accepted

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

for kame in range(100):
    for tsuru in range(100):
        if 4*kame + 2*tsuru == Y and kame + tsuru == X:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

print(ans)

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):
    ans = False
    
    for a in range(0, 101):
        for b in range(0,101):
            if X == a +b and Y==2*a+4*b:
                ans = True
    if ans:
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(X, Y)

if __name__ == '__main__':
    main()

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 = map(int,input().split())
ans = 0
for i in range(x):
  f = 2 * i + 4 * (x - i)
  if f == y:
    ans = 1
if x*2 == y:
  ans = 1
if ans == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
res = False
for x in range(X+1):
    D = X - x
    if Y == (x*2 + D*4):
        res = True
if res:
    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):
    j = X - i
    if Y == (2 * i + 4 * j):
        ans = "Yes"
print(ans)

Submission status: Accepted

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

flag = 0

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

if(flag == 0):
    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')
        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

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

Submission status: Accepted

Solution code:
x, y = [int(i) for i in input().split()]
temp = y - (2*x)
if (temp % 2 != 0) or (temp < 0):
    print("No")
else:
    t1 = x - (temp//2)
    if t1 < 0:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print('No')

Submission status: Accepted

Solution code:

def main():
    import sys
    def input():
        return sys.stdin.readline()[:-1]
    A=list(map(int,input().split()))
    i=0
    X=A[0]
    Y=A[1]
    for b in range(X+1):
        if 2*(X+b)==Y:
            print("Yes")
            sys.exit()
    print("No")


    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

    if turuasi + kameasi == y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
import math
X,Y=map(int,input().split())
#B,W=map(int,input().split())
#N=int(input())

flag=False

for i in range(X+1):
    if i*2+((X-i)*4)==Y:
        flag=True

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

Submission status: Accepted

Solution code:
z = list(map(int, input().split()))
count = 0
for i in range(0, z[0]+1):
  if i*2+(z[0]-i)*4 == z[1]:
    count = 1
if count == 1:
  print('Yes')
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+(x-i)*4==y :
    flag=True
    break
 
if flag :
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

is_exist = False
for gruidaes in range(X + 1):
  turtles = X - gruidaes
  if turtles * 4 + gruidaes * 2 == Y:
    is_exist = True
    break

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

Submission status: Accepted

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

print('No')

Submission status: Accepted

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

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=list(map(int,input().split()))
if Y/2-int(Y/2)!=0:
  print("No")
else:
  a=2*X-Y/2
  b=Y/2-X
  if a>=0 and b>=0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
x, y = map(int, input().split())
if x * 4 < y:
    print("No")
else:
    if y % 2 == 1:
        print("No")
    else:
        if y - 2 * x < 0:
            print("No")
        else:
            print("Yes")

Submission status: Accepted

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

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

else:
    print("Yes")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	x,y = map(int,input().split())
	c = 0
	for i in range(x+1):
		j = x - i
		v = 2 * i + 4 * j
		if v == y:
			c = 1

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main(X, Y):
  if Y % 2 == 1:
    print("No")
    return
  if X*2 > Y:
    print("No")
    return
  if X*4 < Y:
    print("No")
    return
  
  print("Yes")

main(X, Y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import math
import re
import numpy as np
import copy

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

possible = True

#鶴とかめ（切り捨て）
crane = (4*X - Y) // 2
turtle = (-2*X+Y) // 2

if crane < 0 or turtle < 0:
    possible = False

else:
    if crane + turtle != X:
        possible = False
    elif 2*crane + 4*turtle != Y:
        possible = False

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

Submission status: Accepted

Solution code:
x, y = [int(i) for i in input().split()]
if (y - 2*x)%2 == 0 and (4*x - 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())
for i in range(x+1):
    for j in range(x+1-i):
        if i+j == x and i*2 + j*4 == y:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    x, y = map(int, input().strip().split())
    flag = False

    if y % 2 == 1:
        print("No")
    else:
        sum = x * 4
        if sum == y:
            print("Yes")
        else:
            for i in range(x):
                sum -= 2
                if sum == y:
                    print("Yes")
                    flag = True
                    break

            if not flag:
                print("No")

Submission status: Accepted

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

for i in range(x + 1):
    kame = i
    turu = x - i
    kame_leg = i * 4
    turu_leg = (x -i) * 2
    if y == kame_leg + turu_leg:
        ans = 'Yes'
        break
    else:
        ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if 'unittest' not in globals():
    resolve()

Submission status: Accepted

Solution code:
import sys
import math as mt
input=sys.stdin.buffer.readline  
#t=int(input())
mod=10**9+7
t=1
for __ in range(t):
    
    x,y=map(int,input().split())
    
    #n=int(input())
    #a=[[0 for j in range(m)] for i in range(n)]
    ch=0
    for i in range(x+1):
        fo=(x-i)
        ans=i*2+fo*4
       # print(i,fo,ans)
        if ans==y:
            ch=1
            break
    if ch==1:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import numpy as np

XY=np.array(input().split(" "),dtype=np.int32)

X=XY[0]
Y=XY[1]

b_count=0
t_count=0

flag=False
for x in range(X+1):
    b_count=x
    t_count=X-b_count

    legs=2*b_count+4*t_count

    if(legs==Y):
        flag=True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

flag=False

for x in range(0,X+1):
    if (2*x+4*(X-x))==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)/2
b = (y-2*x)/2

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
flag = False
for i in range(2*x, 4*x+1)[::2]:
    if y == i:
        flag = True


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
l = list (map (int, input().strip().split()))
x = l[0]
y = l[1]
flag = False
for i in range(x+1):
    if i == (4*x-y)/2:
        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):
  check = Y - 2*(i +1)
  if check == 4*(X - i -1) or Y == 4*X:
    print("Yes")
    exit(0)
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*4+j*2 == Y and i+j==X:
      print("Yes")
      exit()

print("No")

Submission status: Accepted

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

b = (Y - 2*X) / 2

if 0 <= b <= X and b%1==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

flag = False
for i in range(x+1):
    tsuru = i
    kame = x-i
    if tsuru*2+kame*4==y:
        flag = True
    
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
leg=2*X
ans='No'

if leg==Y:
    ans='Yes'
else:
    for i in range(X):
        leg+=2
        if Y == leg:
            ans='Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
x,y=map(int,input('').split(' '))
q=0
for a in range(x+1):
    s=0
    s+=a*2
    s+=(x-a)*4
    if s==y:
        q=1
        break

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

Submission status: Accepted

Solution code:
# 

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


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

four = X*4
two = X*2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=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:
# 幅優先探索（行きがけ）
import collections
import sys


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    X, Y = LI()
    ans = "No"
    for i in range(X+1):
        for j in range(X+1):
            if i+j > X:
                break
            if 2*i+4*j == Y and i+j == X:
                ans = "Yes"
                print(ans)
                return

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

Submission status: Accepted

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

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

z = 4*x-y
k = False

for i in range(x+1):
    if 2*i==z:
        k = True
print('Yes' if k else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = (int(s) for s in input().rstrip().split())

if ((B - 2 * A) >= 2 or (4 * A - B) >= 2) and (B - 2 * A) >= 0 and (4 * A - B) >= 0 and (B - 2 * A) % 2 == 0 and (4 * A - B) % 2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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


a = -1
b = -1

for j in range(x+1):
    if 2*j + 4*(x-j) == y:
        a = j
        b = (x-j)
        break


if a != -1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
if y%2 == 1:
    print('No')
else:
    ans = 0
    for a in range(x+1):
        b = x-a
        if 2*a + 4*b == y:
            print('Yes')
            break
        else:
            ans += 1
            pass
    if ans == x+1:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

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

flg = 0

for i in range(x+1):
    if y == ((i*2) + ((x-i)*4)):
        flg = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(x):
#  print (i, x-i, i * 2 + (x-i) * 4, i * 4 + (x-1) *2)
  if i * 2 + (x-i) * 4 == y:
    ans = 1
    break
  elif i * 4 + (x-i) *2 == y:
    ans = 1
    break

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

Submission status: Accepted

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

a = []

for i in range(x+1):
    kame = 4*i
    turu = 2*(x-i)
    #print(kame, turu)
    a.append(kame+turu)

if y in a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X, Y = [int(i) for i in input().split(' ')]
a = -0.5 * Y + 2 * X
b = -1 * X + 0.5 * Y
print("Yes" if a.is_integer() and b.is_integer() and a >= 0 and b >= 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

# すべて亀
legs = 4 * x

if legs == y:
    print("Yes")
    exit()

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

# 亀を鶴に置き換えていく
for i in range(x):
    legs -= 2
    if legs == y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

for p in range(101):
    q = x - p
    if q < 0:
        print('No')
        break
    if 2*p + 4*q == y:
        print('Yes')
        break
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:
    if (4*x-y) >= 0 and (4*x-y)%2 == 0:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

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