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: Wrong Answer

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

for x in range(X):
    for y in range(X):
        if x * 2 + y * 4 == Y:
            ans += 1
        else:
            pass

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

Submission status: Wrong Answer

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

for x in range(X+1):
    for y in range(X+1):
        if x * 2 + y * 4 == Y:
            ans += 1
        else:
            pass

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

Submission status: Wrong Answer

Solution code:
values = input().split()
print(values)

num_animals = int(values[0])
num_legs = int(values[1])

max_possible_legs = num_animals*4
min_possible_legs = num_animals*2

if num_legs%2 != 0:
    print ("No")

elif (num_legs <= max_possible_legs) and (num_legs >= min_possible_legs):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
values = input().split()

num_animals = int(values[0])
num_legs = int(values[1])

max_possible_legs = num_animals*4
min_possible_legs = num_animals*2

if num_legs%2 != 0:
    print ("No")

elif (num_legs < max_possible_legs) and (num_legs > min_possible_legs):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

if x[1]%2==0:
    b = 2*x[0] - x[1]/2
    if 0 <= b <= x[1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = 4 * x
if (s - y) // 2 <= x:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
for turtle in range(X+1):
    for crane in range(X+1):
        leg_num = turtle*4 + crane*2
        if Y == leg_num:
            print('Yes')
            quit()
print('No')

Submission status: Wrong Answer

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

a = y / 2
b = 0
while (a + b) != x:
  a -= 2
  b += 1
  if a == -1:
    a = 0
  elif a < -1:
    break

s = 2 * a + 4 * b
if s == y and a >= 0:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

if y % 2 == 1:
  print ("no")
  sys.exit()
  
a = y / 2
b = 0
while (a + b) != x:
  a -= 2
  b += 1
  if a < 0: break

s = 2 * a + 4 * b
if s == y and a >= 0:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

a = y / 2
b = 0
while (a + b) != x:
  a -= 2
  b += 1
  if a < 0: break

s = 2 * a + 4 * b
if s == y and a >= 0:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    if n % 2 != 0:
        print("No")
        exit(0)

    max = n / 2
    min = int(n / 4) + (n % 4) / 2

    print("Yes" if legs >= min and legs <= max else "No")

main()

Submission status: Wrong Answer

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

    if n % 2 != 0:
        print("No")
        exit(0)

    max = n / 2
    min = int(n / 4) + n % 4

    print("Yes" if legs >= min and legs <= max else "No")

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y=map(int, input().split())
p=(4*X+Y)/2
q=(Y-2*X)/2
if p==int(p) and q==int(q):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

for i in range(0, N+1):
  f = i * 2 + (N-i) * 4
  if f == M:
    print("yes")
    break
else:
  print("Np")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
X,Y=MI()

if X*2 > Y and X*4 < Y:
    print('No')
    exit()

if Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
X,Y=MI()

if X*2 < Y and X*4 > Y:
    print('No')
    exit()

if Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
X,Y=MI()

if X*2 < Y or X*4 > Y:
    print('No')
    exit()

if Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
X,Y=MI()

if X*2 < Y:
    print('No')
    exit()

if Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
X,Y=MI()

if X*4 < Y:
    print('No')
    exit()

if Y%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if y%2 : print('No')
else:print('Yes')

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if y in [2*x , 4*x]:print('No')
else:print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for c in range(x+1):
    t = x - c
    if 2*c + 4*t == y:
        ans = "YES"
print(ans)

Submission status: Wrong Answer

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

for t in range(X+1):
    k = X - t
    if t*2 + k*4 == Y:
        p = 1
        break
    else:
        p = 0

if p == 1:
    print("yes")
elif p == 0:
    print("no")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(x+1):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  if(y%2==0 and y/2==x):
    judge='Yes'
  for j in range(x+1-i):
    print(i, j)
    if((i*2+j*4)==y and i+j==x):
      judge='Yes'
    if((i*4+j*2)==y and i+j==x):
      judge='Yes'
      
if(y%2==1):
  judge='No'

print(judge)

Submission status: Wrong Answer

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

for i in range(x+1):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  if(y%2==0 and y/2==x):
    judge='Yes'
  for j in range(x+1-i):
    print(i, j)
    if((i*2+j*4)==y and i+j==x):
      judge='Yes'
      print(i*2, j*4)
    if((i*4+j*2)==y and i+j==x):
      judge='Yes'
      
if(y%2==1):
  judge='No'

print(judge)

Submission status: Wrong Answer

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

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  if(y%2==0 and y/2==x):
    judge='Yes'
  for j in range(x-i):
      if((((i*2+j*4)==y) or ((i*4+j*2)==y)) and i+j==x):
        judge='Yes'
      
if(y%2==1):
  judge='No'

print(judge)

Submission status: Wrong Answer

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

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  if(y%2==0 and y/2==x):
    judge='Yes'
  for j in range(x-i):
      if((i*2+j*4)==y):
        judge='Yes'
      if((i*4+j*2)==y):
        judge='Yes'
      
if(y%2==1):
  judge='No'

print(judge)

Submission status: Wrong Answer

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

def main():
    if (y/2 -x)<=x:
        if y==0 or x==0:
            return 'No'
        if (y/2 -x)%1==0:
            return('Yes')
        else:
            return('No')
    else:
        return('No')
print(main())

Submission status: Wrong Answer

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

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  for j in range(x-i):
      if((i*2+j*4)==y):
        judge='Yes'
      if((i*4+j*2)==y):
        judge='Yes'
      
if(y%2==1):
  judge='No'

print(judge)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
judge='No'
if(y%2==1):
  judge='No'

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0 and y/4==x):
    judge='Yes'
  for j in range(x):
      if((i*2+j*4)==y):
        judge='Yes'
      if((i*4+j*2)==y):
        judge='Yes'
      
    

print(judge)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
judge='No'
if(y%2==1):
  judge='No'

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0):
    judge='Yes'
  for j in range(x):
      if((i*2+j*4)==y):
        judge='Yes'
      if((i*4+j*2)==y):
        judge='Yes'
      
    

print(judge)

Submission status: Wrong Answer

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

def main():
    if (y/2 -x)<=x:
        if (y/2 -x)%1==0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
main()

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
judge='No'
if(y%2==1):
  judge='No'

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  for j in range(x):
    if(x-i>0):
      if((i*2+j*4)==y):
        judge='Yes'
      if((i*4+j*2)==y):
        judge='Yes'
      
    

print(judge)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
judge='No'
if(y%2==1):
  judge='No'

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  for j in range(x-i):
    if((i*2+j*4)==y):
      judge='Yes'
    

print(judge)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
kazu, ashi = map(int, input().split())
tsuru, kame = 0, 0
hantei = 0

for i in range(kazu):
    kame = i
    tsuru = kazu - i
    if kame * 4+ tsuru * 2 == ashi:
        hantei = 1
        break

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

Submission status: Wrong Answer

Solution code:
input = input()

nums = input.split(" ")

animals = int(nums[0])
legs = int(nums[1])

turu = (4*animals -legs)/2.0
kame = (legs-2*animals)/2.0

if turu.is_integer() and kame.is_integer() and turu>0 and kame>0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
if Y/2 == X or Y/4 == X:
    print('Yes')
    exit()


flag = False
for _ in range(X):
    if  Y%2 == 0:
        Y = Y/2
        flag = True
    elif Y%4 == 0:
        Y = Y/4
        flag = True

    else:
        flag = False
if flag and Y == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from fractions import Fraction

a=input()
a=a.split()

X=int(a[0])
Y=int(a[1])

x=Fraction(4*X-Y,2)
y=Fraction(Y-2*X,2)

if x-round(x)==0:
  if y-round(y)==0:
    print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys

def Y_N(a,b):
    for i in range(a):
        if 2 * (a-i) + 4 * i == b:
            return "Yes"
    return "No"

if __name__ == '__main__':
  input = sys.stdin.readline

  s = input().rstrip()

  ar = list(map(int,s.split()))
  
  print(Y_N(ar[0],ar[1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x * 4 < y:
    print("No")

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
n = (4*x - y)/2
m = (y - 2*x)/2

if n > 0 and m > 0:

    if n == int(n) and m == int(m):
      print("Yes")
    else:
      print("No")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if(b%2!=0):
    print("NO")
else:
    z = 2*a 
    y = 4*a
    if(b>=z and b<=y):
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if(b%2!=0):
    print("NO")
else:
    z = b//2 
    y = b//4
    if(a>=y and a <=z):
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

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

x,y = map(int,input().split())
if y>4*x:
    print('No')
    sys.exit()
if y == 2*x or 4*x:
    print('Yes')
    sys.exit()
if y%4==0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

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

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

Submission status: Wrong Answer

Solution code:

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

if X * 4 < Y:
    print("No")
else:
    while (1):
        if Y % 4 == 0:
            Y = Y - 4
        elif Y % 2 == 0:
            Y = Y - 2
        else:
            print("No")
            break

        if Y == 0:
            print("Yes")
            break

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
y =2*X-Y/2
x = X - y
s =4*x+2*y  
if s == Y:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
y =2*X-Y/2
if y.is_integer() and y >= 0:
     x = X - y
     s =4*x+2*y  
     if s == Y:
         print("Yes")
     else:
         print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
y =2*X-Y/2
if y.is_integer():
     x = X - y
     s =4*x+2*y  
     if s == Y:
         print("Yes")
     else:
         print("No")

Submission status: Wrong Answer

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

if x*4<y:
    print("No")

elif y/2<x:
    print ("No")

elif y % x == 2:
    print("Yes")

elif y % x == 0:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

if x*4<y:
    print("No")

elif x/2>y:
    print ("No")

elif y % x == 2:
    print("Yes")

elif y % x == 0:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
animals,legs= map(int,input().split())
if legs%2 !=0 or animals*2>legs or animals*4<legs: print("no")
else: print("yes")

Submission status: Wrong Answer

Solution code:
animals,legs= map(int,input().split())
if animals%2 !=0 or animals*2>legs or animals*4<legs: print("no")
else: print("yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if y % x == 2:
    print("Yes")

if y % x == 0:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
      
C=2
T=4
B=(4*X)
A=Y%2
end=False


if Y > B:
      print("No")
      end=True
      
if end==False and A == 0:
      print("Yes")
if end==False and A !=0 :
      print("No")

Submission status: Wrong Answer

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

for count in range(0, x):
    i += 4

for count in range(0, x):
    if i > y:
        i -= 2

    if i == y:
        print("yes")
        sys.exit()

print("no")

Submission status: Wrong Answer

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

b = y // 2
a = y // 4


if y % 2 != 0:
    print("No")
else:
    if a <= x <= b:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = int(- y / 2 + 2 * x)
b = int(y / 2 - x)

if a == 0 and b == 0:
    print('No')
elif a < 0 or b < 0:
    print('No')
elif a >= 0 and b >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = int(- y / 2 + 2 * x)
b = int(y / 2 - x)

if a == 0 and b == 0:
    print('No')
elif a >= 0 and b >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = - y // 2 + 2 * x
b = y // 2 - x

if a == 0 and b == 0:
    print('No')
elif a < 0 and b < 0:
    print('No')
elif a >= 0 and b >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = - y // 2 + 2 * x
b = y // 2 - x

if a == 0 and b == 0:
    print('No')
elif a > 0 and b > 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = - y // 2 + 2 * x
b = y // 2 - x

if a == 0 and b == 0:
    print('No')
elif a >= 0 and b >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = - y // 2 + 2 * x
b = y // 2 - x

if a >= 0 and b >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    x, y = rl()
    if y % 2 == 1:
        print ("NO")
    elif 2 * x <= y <= 4 * x:
        print ("YES")
    else:
        print ("NO")






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
line = input().split()

hontai = int(line[0])
ashi = int(line[1])
flag = "true"

for i in range(hontai+1):
  kame = int(i)
  tsuru = int(hontai-kame)
  if ashi == (4*kame)+(2*tsuru):
    print("yes")
    flag = "false"
    break

if flag=="true":
  print("no")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = list(map(int,input().split()))
## １頭の条件
if x == 1:
  if (y == 2) or (y == 4):
    print("Yes")
  else:
    print("No")
    
## 51頭以上はそもそもNo    
elif x > 50:
  print("No")
  
##2頭以上の条件
else:   
  check = True
  for i in range(x+1):
    if sum([2]*(i) + [4]*(50-i)) == y:
      print("Yes")
      check=False
      break
  if check:
    print("No")

Submission status: Wrong Answer

Solution code:
import itertools
x,y = list(map(int,input().split()))
## １頭の条件
if x == 1:
  if y == 2:
    print("Yes")
  elif y == 4:
    print("Yes")
  else:
    print("No")
    
## 51頭以上はそもそもNo    
elif x > 50:
  print("No")
##2頭以上の条件
else:   
  check = True
  for i in range(x):
    if sum([2]*(i) + [4]*(50-i)) == y:
      print("Yes")
      check=False
      break
  if check:
    print("No")

Submission status: Wrong Answer

Solution code:
import itertools
x,y = list(map(int,input().split()))
## １頭の条件
if x == 1:
  if y == 2:
    print("Yes")
  elif y == 4:
    print("Yes")
  else:
    print("No")
    
## 51頭以上はそもそもNo    
elif x > 50:
  print("No")
##2頭以上の条件
else:   
  lists = [2] + [4]
  lists = itertools.product(lists, repeat=50)
  check = True
  for i in lists:
    if sum(i) == y:
      print("Yes")
      check = False
      break
  if check:
    print("No")

Submission status: Wrong Answer

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

if x == 1:
  if y == 2:
    print("Yes")
  elif y == 4:
    print("Yes")
  else:
    print("No")
else:   
  lists = [2]*(x-1) + [4]
  if sum([4]*x) > y:
    print("No")
  else:
    lists = itertools.permutations(lists)
    check = True
    for i in lists:
      if sum(i) == y:
        print("Yes")
        check = False
        break
    if check:
      print("No")

Submission status: Wrong Answer

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

lists = [2]*(x-1) + [4]
lists = itertools.permutations(lists)
check = True
for i in lists:
  if sum(i) == y:
    print("Yes")
    check = False
    break
if check:
  print("No")