Problem:


Score : 200 points

Problem Statement

There are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.

Takahashi says: "there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.

Constraints

1 \leq X \leq 100

1 \leq Y \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.

Sample Input 1

3 8

Sample Output 1

Yes

The statement "there are 3 animals in total in the garden, and they have 8 legs in total" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.

Sample Input 2

2 100

Sample Output 2

No

There is no combination of numbers of cranes and turtles in which this statement is correct.

Sample Input 3

1 2

Sample Output 3

Yes

We also consider the case in which there are only cranes or only turtles.



Sample input:
3 8


Sample output:
Yes

Submission status: Accepted

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

turu = X
kame = 0
flag = False
for i in range(X+1):
    if turu*2 + kame*4 == Y:
        flag = True
        break
    else:
        turu -= 1
        kame += 1
        
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
nums =[int(e) for e in input().split()]

count=0
for i in range(nums[0]+1):
    if 2*i+4*(nums[0]-i)==nums[1]:
        print("Yes")
        count=1
        break

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

Submission status: Accepted

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

ans = "Yes"
if Y%2 == 1:
    ans = "No"
elif Y < 2*X:
    ans = "No"
elif Y > 4*X:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
x,y = map(int, input().split())		# 5 7 2

ans="Yes"

if x*4 < y: ans = "No"
if y < x*2: ans = "No"
if y%2==1: ans = "No"

print(ans)

Submission status: Accepted

Solution code:
data = input().rstrip().split(" ")
total = int(data[0])
legs = int(data[1])
if legs % 2 ==0 and total >= legs/4 and total <= legs/2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
num_animal, num_leg = map(int, input().split())

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

if num_animal * 2 <= num_leg <= num_animal * 4:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

    A = [2] * x
    for i in range(x):
        if sum(A) == y:
            print('Yes')
            exit()

        A[i] = 4

    if sum(A) == y:
        print('Yes')
        exit()

    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def judge(x, y):
    p2, q2 = 4 * x - y, y - 2 * x
    return p2 % 2 == 0 and q2 % 2 == 0 and p2 >= 0 and q2 >= 0


def main():
    x, y = (int(z) for z in input().split())
    if judge(x, y):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X , Y = (int(a) for a in input().split())
a = Y - 2*X
b = 4*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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    x, y = map(int, readline().split())
    f = False
    for n in range(1000):
        for m in range(1000): 
            if (2*n+4*m == y) and (n+m == x):
                f = True
                break
    if f:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    main()

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())
min_num = x * 2
max_num = x * 4

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

Submission status: Accepted

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

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

if hantei(x, y) == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    X,Y=map(int,input().split())
    crane=(Y-2*X)/2
    if crane!=int(crane):
        print("No")
        sys.exit()
    turtle=X-crane
    if crane>=0 and turtle>=0:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

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:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

X,Y = map(int,input().split())
ans = 0
flag = 0

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

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

Submission status: Accepted

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

ok = False
for i in range(x):
    turu = i
    kame = x-i
    legs = turu*2 + kame*4
    if legs == y:
        ok = True
        break

    kame = i
    turu = x - i
    legs = turu*2 + kame*4
    if legs == y:
        ok = True
        break

if ok:
    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:
x,y = map(int,input().split())
b = (y-2*x)//2
a = x-b

if (a >= 0 and b >= 0) and (a+b == x and 2*a + 4*b == y):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	#data = [2]
	data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	#ans = [x for x in data if x!=0]
	ans = data[:]
	return ans

x,y = readInts()

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

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

Submission status: Accepted

Solution code:
x, y = (int(i) for i in 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())
flag = False
for x in range(X+1):
	kame = x
	tsuru = X - x
	if (kame * 4) + (tsuru * 2) == Y:
		flag = True
		break

if flag:
	print("Yes")
else:
	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):
    foot = 4 * X
    for _ in range(X + 1):
        if foot == Y:
            print(YES)
            return
        
        elif foot > Y:
            foot -= 2
        
        else:
            break
    
    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:
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:

import glob
import os

bn = os.path.basename(__file__).split('.')[0]
dn = os.path.dirname(__file__).split('/')

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = dn[len(dn)-2] + '\\' + dn[len(dn)-1] + '\\' + bn

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

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


solver = Solver(REL_PATH)
solver.exec_resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

    print(ret)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def ok(n):
    if n==n//1 and n >=0:
        return True
    else:
        return False

if ok((y/2)-x) and ok(2*x-y/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 + 4*j == y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
# 2020/06/14
# AtCoder Beginner Contest 170 - B

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

# Calc
# i is Tsuru
ans = 'No'
for i in range(0, 101):
    # j is Kame
    for j in range(0, 101):
        if i + j == x and i * 2 + j * 4 == y:
            ans = 'Yes'
            break

# Output
print(ans)

Submission status: Accepted

Solution code:
# coding=UTF-8
from collections import deque
from operator import itemgetter
from bisect import bisect_left, bisect
import itertools
import sys
import math
import numpy as np
import time
sys.setrecursionlimit(10**6)
input = sys.stdin.readline


def main():
    x, y = map(int, input().split())
    flg = 0
    for i in range(x+1):
        if 2 * (i) + 4 * (x - i) == y:
            flg = 1
            break
    if flg == 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(x + 1):
    tmp = i * 2 + (x - i) * 4
    if tmp == y:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

    else:
        print("Yes")

resolve()

Submission status: Accepted

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

for K in range(0,101):
    for T in range(0,101):
        A = K + T
        B = 2*K + 4*T
        if A == X and B == Y:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(X, Y):
    T = Y - 2 * X
    if T < 0 or T % 2 != 0:
        return False
    T //= 2
    C = X - T
    if C < 0:
        return False
    return True


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

Submission status: Accepted

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

x = (4*X - Y) / 2
y = (Y - 2*X) / 2

if x >= 0 and x.is_integer() and y >= 0 and y.is_integer():
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x,y = (int(x) for x in input().split())
flag = False
for a in range(101):
    for b in range(101):
        if a+b==x and 2*a+4*b==y:
            flag = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=input().split()
x=int(x)
y=int(y)
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 i*4 + (X - i) * 2 == Y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
x, y = map(int, input().split())
min = 2*x
max = 4*x

if y%2 == 0 and min <= y and max >= y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

b = (Y - 2 * X) // 2
a = X - b

if a >= 0 and b >= 0 and (2*a + 4*b) == Y:
    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()))

result = 'No'
for i in range(0, 101):
    for j in range(0, 101):
        XX = i + j
        YY = i * 2 + j * 4
        if X == XX and Y == YY:
            result = 'Yes'

print(result)

Submission status: Accepted

Solution code:
def resolve():
    x, y = map(int, input().split())
    if y > 4*x:
        print('No')
        return
    if y < 2*x:
        print('No')
        return

    if y % 2 == 0:
        print('Yes')
        return
    print('No')
    return

resolve()

Submission status: Accepted

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

if (y > x*4) or (y < x*2):
	print("No")
elif (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):
    tsuru = i
    kame = X - i

    if i * 2 + kame * 4 == Y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

ans = "No"
for i in range(101):
    if ans != "No":
        break
    for j in range(101):
        if i+j != X:
            continue
        if i*2 + j*4 == Y:
            ans = "Yes"
            break
print(ans)

Submission status: Accepted

Solution code:
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    x, y = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

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

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


resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = list(map(int,input().split()))
for kame in range(X + 1):
    if (kame * 4) + ((X-kame) * 2) == Y:
        print("Yes")
        exit()
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:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

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

Submission status: Accepted

Solution code:
x, y = [int(i) for i in input().split()]
if (4*x - y) % 2 == 0 and (-2*x + y) % 2 == 0 and 4*x - y >= 0 and (-2*x + y)>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

b = y 
flag = False
if y % 2 == 0:
    b = y // 2 - x
    a = x - b
    if b >= 0 and a >= 0:
        flag = True

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
n = X 
m = 0
while n >= 0:
    if n * 4 + m * 2 == Y:
        print("Yes")
        exit()
    else:
        n -= 1
        m += 1
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def positive_and_even(n):
    return n >= 0 and n % 2 == 0


print('Yes' if positive_and_even(4 * X - Y) and positive_and_even(-2 * X + Y) else 'No')

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    X, Y = map(int, readline().split())
    a = (4*X-Y)/2
    b = (Y-X*2)/2
    if a.is_integer() and a>=0 and b.is_integer() and b>=0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################

def solve():
    x,y = invr()
    w = (y / 2) - x
    q = x - w
    if math.ceil(q) == q and q >= 0 and math.ceil(w) == w and w >= 0:
        print("Yes")
    else:
        print("No")
            
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
    return(q)

def power_two(n):
    if n == 1:
        return(True)
    sttr = str(n)
    len_str = len(sttr)
    sttr = list(sttr)
    num = 0
    if (len_str == 1 and sttr[len_str - 1] == '1'): 
        return(False)
    while (len_str != 1 or sttr[len_str - 1] != '1'):
        if ((ord(sttr[len_str - 1]) - ord('0')) % 2 == 1):
            return(False)
        j = 0; 
        for i in range(len_str):  
            num = num * 10 + (ord(sttr[i]) - ord('0')); 
            if (num < 2): 
                if (i != 0):  
                    sttr[j] = '0'
                    j += 1
                continue
  
            sttr[j] = chr((num // 2) + ord('0'))
            j += 1; 
            num = (num) - (num // 2) * 2
        len_str = j
    return(True)

def getLeftmostBit(n): 
    m = 0
    while (n > 1) : 
        n = n >> 1
        m += 1
    return(m)
def getNextLeftmostBit(n, m) : 
    temp = 1 << m 
    while (n < temp) : 
        temp = temp >> 1
        m -= 1
    return m
def bitcounter(n) :
    m = getLeftmostBit(n) 
    return _countSetBits(n, m) 
def _countSetBits(n, m) :
    if (n == 0) : 
        return 0
    m = getNextLeftmostBit(n, m)
    if (n == (1 << (m + 1)) - 1) : 
        return ((m + 1) * (1 << m))
    n = n - (1 << m)
    return (n + 1) + bitcounter(n) + m * (1 << (m - 1)) 

def log_two(n): 
    return(math.log(n) / math.log(2))

#-----------------------------------------------------------------------#
        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
    
main()

Submission status: Accepted

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

socks = x*4
f = 0
for _ in range(x+1):
  if socks == y:
    f += 1
    break
  socks -= 2
  
if f == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

def main(x,y):
    if(y%2==1):
        return 'No'
    ymin=2*x
    ymax=4*x
    if (ymin<=y) and (y<=ymax):
        return 'Yes'
    else:
        return 'No'

if __name__=='__main__':
    x,y=readinput()
    ans=main(x,y)
    print(ans)

Submission status: Accepted

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

is_yes = False
for i in range(0, X+1):
    if 2*i+4*(X-i) == Y:
        is_yes = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    # S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    X, Y = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

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


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


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)

    def test_入力例_4(self):
        input = """0 0"""
        output = """Yes"""
        self.assertIO(input, output)