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

Submission status: Accepted

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

X,Y=(int(x) for x in input().rstrip('\n').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())
ans = "No"
for n in range(X+1):
    if 4*X-2*n == Y:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

Solution code:
num_of_animals, num_of_foot = map(int, input().split())

for i in range(num_of_animals + 1):
    # 鶴の数を0からインクリメント
    if 2 * i + 4 * (num_of_animals - i) == num_of_foot:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
A = Y // 2
B = int(A / 2 + 0.5)
if (B <= X <= A) and (not bool(Y % 2)):
    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 intMap(): return map(int,input().split())

x,y = intMap()

ans = 'No'
if x * 2 == y: ans = 'Yes'
if x * 4 == y: ans = 'Yes'

for crane in range(x):
    turtle = x - crane
    feet = crane * 2 + turtle * 4
    if feet == y:
        ans = 'Yes'

print(ans)

Submission status: Accepted

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

if Y % 2 ==1:
    ans = "No"

if Y > 4*X:
    ans = "No"

if Y < 2*X:
    ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
X, Y = map(int, input().split())
if X*4 < Y:
    print('No')
    sys.exit()
else:
    i, j = 0, X
    while j >= 0:
        if 2*i + 4*j == Y:
            print('Yes')
            sys.exit()
        else:
            i += 1
            j -= 1
    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())

z = y - 2*x

if(z < 0):
    print("No")
elif (z/2 <= x and z%2 == 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import math
import scipy as sp
import queue
import collections

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

def main(kwargs):
    x = kwargs["x"]
    y = kwargs["y"]
    res = "No"

    if y - 2 * x >= 0 and (y - 2 * x) % 2 == 0 and 4 * x - y >= 0 and (4 * x - y) % 2 == 0:
        res = "Yes"

    return res

if __name__ == "__main__":
    kwargs = {}

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

    cout = main(kwargs)
    print(cout)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:

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

    if y%2 == 0:
        if 0 <= y/2-x <=x:
            print('Yes')
        else:
            print('No')
    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):
    for j in range(x-i+1):
        l = 2*i + 4*j
        k = i + j
        if l == y and k == x:
            ans = 'Yes'
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    X, Y = map(int, input().split())

    #output
    #a + b =  X
    #2*a + 4*b = Y
    if 4*X - Y >= 0 and Y % 2 == 0 and Y - 2*X >= 0:
        print("Yes")
    else:
        print("No")

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#import numpy as np
import sys
#from collections import deque
#import copy


def xnxn(n=0, flag="v"):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4 
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            if flag == "l":
                return temp
            else:
                return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


x, y = xnxn()

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

    tsuru = x
    kame = 0

    while tsuru >= 0:
        if tsuru * 2 + kame * 4 == y:
            return "Yes"
        tsuru -= 1
        kame += 1
    

    return "No"

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
flag = False
for i in range(0,100):
    for n in range(0,100):
        if i + n == x and 2*i + 4*n ==y:
            flag = True
if flag :
    print("Yes")
else :
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

if Y % 2 !=0:
    pass
else:
    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:
X,Y = map(int,input().split())

if 4*X < Y or Y%2 != 0 or Y < 2*X:
  ans = 'No'
else:
  ans = 'Yes'

print(ans)

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

import itertools
from collections import deque,Counter
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7

x,y = MAP()

c = (4*x - y)
t = ((-1)*2*x+y)

if c >= 0 and t >= 0:
  if c%2 == 0 and t%2 == 0:
    print('Yes')
    exit()
  
  
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range (0, X + 1):
    tsuru = i
    kame = X - i
    if tsuru*2 + kame*4 == Y:
        index = 1
        break

if index == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def check(x, y):
    if x < 0:
        return "No"
    elif y < 0:
        return "No"
    if y // 1 == y and x // 1 == x:
        return "Yes"
    else:
        return "No"


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

y = (Y - 2 * X) / 2
x = X - y
print(check(x, y))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
a = (4*X-Y)//2
b = X-a

# print(a, b, X, Y, a+b, 2*a+4*b)

if a+b == X and 2*a+4*b == Y and a >= 0 and b >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
import bisect
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return x if y == 0 else gcd(y, x%y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

X, Y = LI()

flag = False

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

YesNo(flag)

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

Submission status: Accepted

Solution code:
import itertools

A, B = map(int, input().split())

l = [2, 4]
hoge = itertools.combinations_with_replacement(l, A)

flag = False
for v in hoge:
    if sum(v) == B:
        flag = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 14 21:05:44 2020

@author: NEC-PCuser
"""
X, Y = map(int, input().split())

max_fit = X * 2
min_fit = X * 4

if (Y % 2 == 0 and max_fit <= Y and min_fit >= Y):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

all_kame = 2 * X
all_tsuru = 4 * X

if Y % 2 == 0 and Y >= all_kame and Y <= all_tsuru :
  print("Yes")
else :
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

x = a[0]
y = a[1]


def total(x,y,n):
    total = 4 * n + 2 * (x - n)
    return total

for var in range(0,x + 1):
    ans = total(x,y,var)
    if (ans == y):
        print("Yes")
        break
    else:
        if (var == x):
            print("No")
            break
        else:
            continue

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if f:
    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"
    else:
        pass

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,m=[int(n) for n in input().split()]
if(m>(n*4) or m<(n*2)):
  print("No")
else:
  if(m%2==0):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
x, y = map(int,input().split()) #xが匹、Yが足の数
if (2*x > y or 4*x < y or y%2 != 0):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor

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

a = 2 * X - 0.5 * Y
b = 0.5 * Y - 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())


b = y / 2 - x
a = x - b
if int(b) == b and b >= 0 and a >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    x,y = mi()
    flag = False
    for i in range(x+1):
        if i*2+(x-i)*4 == y:
            flag = True
    if flag:
        print(yes)
    else:
        print(no)



main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if y % 2 == 0 and x * 2 <= y and x * 4 >= y:
    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 a>=0 and b>=0 and b==int(b):
    print("Yes")
else:
    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:
# from math import factorial,sqrt,ceil #,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# from bisect import bisect_left
# from heapq import heappush,heappop
# from numba import njit
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from fractions import gcd

# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np    # numpy.lcm()
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb,perm #permはnPk
# import networkx as nx
# G = Graph()

# slist = "abcdefghijklmnopqrstuvwxyz"
X,Y = map(int,input().split())

for num in range(1,X+1):
    asi1 = num*4 + (X-num)*2
    asi2 = num*2 + (X-num)*4
    if asi1 == Y or asi2 == Y:
        print("Yes")
        exit()
    
print("No")
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9
import fractions

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    X, Y = mulinputs()

    # 出力
    # a = Y - 2*X
    # b = 4*X - Y
    # judge = a % 2 == 0 or b % 2 == 0
    # print(yn[not judge::2])
    for i in range(X+1):
        x, y = i, X - i
        if 2*x + 4*y == Y or 2*y + 4*x == 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:
X,Y = map(int,input().split( ))
if (X*4 >= Y) and (X*4 - Y)%2 == 0 and (X*4 - Y)//2 <= X:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)


def read():
    X, Y = list(map(int, input().strip().split()))
    return X, Y


def solve(X, Y):
    if 4 * X == Y:
        return "Yes"
    elif 2 * X == Y:
        return "Yes"
    else:
        b = (Y - 2 * X) // 2
        a = X - b
        if a > 0 and b > 0 and a + b == X and 2 * a + 4 * b == Y:
            return "Yes"
    return "No"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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().strip().split())

# 鶴: c, 亀: t
#   c +   t = x
# 2 c + 4 t = y

found = False
for c in range(101):
    for t in range(101):
        if c + t == x and 2 * c + 4 * t == y:
            found = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solution(X, Y):
    for n_tsuru in range(X + 1):
        for n_kame in range(X + 1):
            if n_tsuru + n_kame == X and 2 * n_tsuru + 4 * n_kame == Y:
                return 'Yes'
    return 'No'
X, Y = map(int, input().split())
print(solution(X, Y))

Submission status: Accepted

Solution code:
number, feet = map(int, input().split())
if feet % 2 != 0:
    result = 'No'
elif (feet <= number * 4) and (feet >= number * 2):
    result = 'Yes'
else:
    result = 'No'
print(result)

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