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:
N, M = map(int,input().split())
for i in range(1, N+1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
      print("Yes")
      #print(f'鶴が{i}匹の足が{i * 2}本、亀が{N - i}匹の足が{M - i * 2}本。')
      break
else:
  #print('普通の鶴と亀ではないようです。')
  print("No")

Submission status: Wrong Answer

Solution code:
def crane_and_turtle():
    input_value = [int(i) for i in input().split()]
    animals = input_value[0]
    legs = input_value[1]

    turtle = (legs - (2 * animals)) / 2
    crane = animals - turtle

    if crane >= 0:
        print("Yes")
    elif crane < 0:
        print("No")
        
crane_and_turtle()

Submission status: Wrong Answer

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

b=abs(y-2*x)


if b==0:
  print('Yes')
elif b<0:
  print('No')
elif b%2!=0:
  print('No')
  
elif x >=b/2:
  
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
c = 2*x - 0.5*y
if c.is_integer() and y >= x*2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

for i in range(1,X+1):
    foot = 2*i+4*(X-i)
    if foot==Y:
        print('Yes')
        break
    elif X==1 and Y==4:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
z =-2
for i in range(x):
    if i % 2 == 0:
        z +=4
    else:
        z +=2
if z == y or z == (y-2):
        print("Yes")
elif z!=y :
        print("No")

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
x=A[0]
y=A[1]
i=(y-2*x)/2
j=2*x-y/2
if i.is_integer() and j>=0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1):
    print('No')
    return
  if (nl / 4.0) > nb:
    print('No')
    return
  for i in range(1, nb + 1):
    if ((nb - i) * 4 + i * 2) == nl:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = b - 2*a
w=b-4*a
d = c / 2

if(a==(c+d)):
    print("Yes")

elif(c==0 or w==0):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

m=4*x
yf=y//4

ans='Yes'

if m<y:
    ans='No'
elif y%2!=0:
    ans='No'
elif y/2==x or y/4==x:
    pass
elif yf+1<=x:
    pass
else:
    ans='No'

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

t = b//a
if a ==1 and b == 1:
    print("NO")
elif a == 1 and b ==2:
    print("YES")
elif t <= a:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

Solution code:
import sys
X, Y = map(int, input().split())
if X*4 < Y:
  print('No')
  sys.exit(0)
diff = Y - X*2
quo, remain = divmod(diff, 2)
if remain == 0:
  if quo > X:
    print('No')
  else:
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

ans = X * 4
count = ans/4 -1 
if ans > Y:
    if X - count == 1:
        print('Yes')
    else:
        print('No')
else:
    if count == X:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = b - 2*a
w=b-2*a
d = c / 2

if(a==(c+d)):
    print("Yes")

elif(c==0 or w==0):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    souwa,ashi=map(int,input().split())
    if souwa*2==ashi or souwa*4==ashi:
        print('Yes')
    else:
        turu=(ashi-souwa*2)
        if turu<0:
            print('No')
            return
        kame=turu/2
        turu=abs(souwa-kame)
        if kame+turu==souwa:
            print('Yes')
        else:
            print('No')
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

b=abs(y-2*x)


if b==0:
  print('Yes')
elif b<0:
  print('No')
elif b%2!=0:
  print('No')
  
elif x >=b/2:
  print(x,y,b/2)
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

m=4*x
yf=y//4

ans='Yes'

if m<y:
    ans='No'
elif y%2!=0:
    ans='No'
elif y%2==x or y%4==x:
    pass
elif yf+1<=x:
    pass
else:
    ans='No'

print(ans)

Submission status: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1):
    print('No')
    return
  if (nl / 4.0) > nb:
    print('No')
    return
  for i in range(1, nb + 1):
    if ((nb - i) * 4 + i * 2) == nl:
      print('Yes')
  print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x and a>=0 and z%2==0:
    print('yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
x, y = map(int, input().split())
ans = -1

a = np.array([[2, 4], [1, 1]])
b = np.array([y, x])
c, d = np.linalg.solve(a, b)
c = int(c)
d = int(d)
print(c, d)
if c + d == x and c >= 0 and d >= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# a: 総数hiki， b: 足の数
a, b = map(int, input().split())

# かめiひき
for i in range(a+1):
  total = 4*i + 2*(a+1-i)
  if total == b:
    ans = 'Yes'
    break
  else:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict

x,y = map(int,input().split())
if x*4 < y:
    print('No')
    sys.exit()
elif y%2 == 1:
    print('No')
    sys.exit()

for i in range(1, x):
    # 足の数
    f = 2 * i + 4 * (x - i)
    if f == y:
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

turtles = (Y - 2*X) / (4 - 2)
cranes = (4*X - Y) / (4 - 2)
check = int(turtles + cranes)

if X == check:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
if A[1]/2 == A[0]:
    print("Yes")
elif A[1]/4 == A[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

y = (a - b) // 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l= input().split(' ')
x= int(l[0])
y= int(l[1])

def f(x,y):
	for i in range(2*x, 4*x+1):
		if i==y:
			return 'Yes'
	return 'No'

print(f(x,y))

Submission status: Wrong Answer

Solution code:
x, y = [int(x) for x in input().split()]
CRANE = 2
TURTLE = 4

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

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

if y > (TURTLE * x):
    print("No")

print("YES")

Submission status: Wrong Answer

Solution code:
a = input().split()
b = int(a[0])
c = int(a[1])

X = 2
Y = 4
for i in range(b+1):
    if b == 1 and c == 2:
        print('Yes')
        break
    elif b == 1 and c == 4:
        print('Yes')
        break
    d = b-i
    if X*i + Y*d == c:
        print('Yes')
        break
    elif i == b-1:
        print('No')

Submission status: Wrong Answer

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

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

for i in range(x):
    if (y-x*2)%((x-1)*4):
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
a=input().split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
b=0
m=0
while b<a[0]:
    if a[1]>=4:
        a[1]=a[1]-4
    if a[1]>=2 and a[1]<4:
        a[1]=a[1]-2
    b=b+1
    if a[1]==0 and b!=a[0]-1:
        print('No')
        m=m+1
        break

if a[1]==0 and m==0:
    print('Yes')
    m=m+1
if m==0:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

turu = (4*x-y)//2
# print(turu)

if (turu < 0) or (x >= y):
    print("No")
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1):
    print('No')
    return
  if (nl / 4.0) > nb:
    print('No')
    return
  for i in range(1, nb):
    if ((nb - i) * 2 + i * 4) == nl:
      print('Yes')
  print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

if t ==2 or t ==4 or t ==6:
  a=1

for i in range(b):
  for y in range(b-i):
    if (2*i) + (4*y) == t:
      a=1
      
if a == 1:
  print("Yes")
elif a == 0:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input(). split ())
if not a % 2 == 0 and not b % 2 == 0:
    print('NO')
elif a > 100 or b > 100:
    print('NO')
elif not isinstance(a, int) or not isinstance(b, int):
    print('NO')
elif 2 * a <= b <= 4 * a:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import math


X,Y=map(int, input().split())
if math.isclose(-Y//2+2*X, round(-Y//2+2*X)) and math.isclose(Y//2-X, round(Y//2-X)):
    if Y//2-X>0 and -Y//2+2*X>0:
        print("Yes")


    elif Y//2-X>=0 and -Y//2+2*X>0:
         print("Yes")


    elif Y//2-X>0 and -Y//2+2*X>=0:
         print("Yes")

    else:
         print("No")


else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def animal(x,y):
    if x==0 or y==0:
        return("No")
    if x==1 and y==2:
        return("Yes")
    if x==1 and y==4:
        return("Yes")
    for i in range(1,101):
        for j in range(1,101):
            if i*2+j*4==y and i+j<=x:
                print(i, j)
                return("Yes")
    return("No")


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

a = (Y - 2 * X) / 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = input()
c = c.split(' ')
x = int(c[0])
y = int(c[1])
sa = 4 * x -y
sa /=2
sb = x - sa
all = sa * 2 + sb * 4
if all == y:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
import math


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


def inputArray():
    return input().rstrip().split()


def inputVars():
    return map(int, input().rstrip().split())


def inputNum():
    return int(input())


def main():
    totalAnimals, noOfLegs = inputVars()
    if noOfLegs > totalAnimals*4:
        print('No')
    else:
        temp = noOfLegs//4
        if noOfLegs%2 == 0 and noOfLegs >= temp:
            print('Yes')
        else:
            print('No')


#.........................................FAST INPUT OUTPUT.......................................
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

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

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

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

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


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


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

#....................................END OF FAST I/O............................................

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

a = x * 4 # 足の最大数
b = a - y # 最大数 - 実際の本数

d = b % 2 # 割り切れるかチェック

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

Submission status: Wrong Answer

Solution code:
X,Y = map(int, input().split())
if (X*4 < Y):
  print("No")
  exit(0)

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

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
kame = (y - 2*x) / 2
tsuru = x - kame
if kame.is_integer() and tsuru.is_integer():
  if kame > 0 and tsuru >= 0:
    print('Yes')
  elif tsuru > 0 and kame >= 0:
    print('Yes')

print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for turu in range(x+1):
    turu = turu
    kame = x - turu
    if kame*4 + turu*2 == y:
        print("Yes")
        frag = 1
        break
print("No" if flag == 0 else "")

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
  x, y = map(int, input().split())
  r4 = y//4
  r2 = y//2
  if r4 == x or r4+1 == x or r2 == x or r2-1 == x:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

turu = (4* X - Y)/2

if turu.is_integer() and turu >= 1 and turu <= 100:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
c = input()
c = c.split(' ')
x = int(c[0])
y = int(c[1])
sa = 4 * x -y
sa /=2
sb = x - sa
all = sa * 2 + sb * 4
print(all)
if all == y:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

XY = list(map(int,input().split()))

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

A = np.array([
    [1,1],
    [2,4]
])

b = np.array([X,Y])

x = np.linalg.solve(A,b)

print(x)

if x[0] >= 0 and x[1] >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1):
    print('No')
    return
  if (nl / 4.0) > nb:
    print('No')
    return
  for i in range(nb, 1, -1):
    if (nl % (i * 4)) % 2 == 0:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

turu_all = 2 * x
kame = (y - turu_all) / 2

turu = x - kame
if x == turu + kame:
    ans = "Yes"
    if turu < 0 or kame < 0:
        ans = "No"

print(ans)

Submission status: Wrong Answer

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

for turu in range(1,x+1):
    turu = turu
    kame = x - turu
    if kame*4 + turu*2 == y:
        print("Yes")
        frag = 1
        break
print("No" if flag == 0 else "")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mm = l*4

a = (mm - m) % 2
b = (mm - m) // 2

if mm == m and mm // 4 == l or (m*2) == m and mm // 2 == l:
  print("Yes")
elif m == 0 or l == 0:
  print("No")
elif b<0:
  print("No")
elif a == 0:
  if b + (l-b) == l:
    print("Yes")
  else:
    print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
c=2
t=4
a=[]
val=0
v=0
flag=0
x,y = map(int, input().split())

for i in range(1,x+1):
    val=i*c
    v=i*t
    a.append(val)
    a.append(v)

if y in a:
    flag=1
if y==(x*c):
    flag=1
if y==(x*t):
    flag=1
    
if flag==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(1)] 
li = list(map(float, s[0].split()))
li1 = li[0]
li2 = li[1]
y = ((li2 /2 - li1) * 10)%10
if y == 0:
    if 2*li1 - li2 /2 >= 0:
        print("Yes")
    if 2*li1 - li2/2 < 0:
        print("No")
if y != 0:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

def solve(n, m):
  for i in range(n):
    if (4*i + 2*(n-i)) == m:
      return i;

  return -1;


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

#print(X)
#print(Y)

r = solve(X, Y)
if r >= 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
ans = False
if (a[1] // 6 * 2) == a[0]:
  ans = True
elif (a[1] // 2 ) == a[0]:
  ans = True
elif (a[1] // 4 ) == a[0]:
  ans = True
for i in range(a[0]):
  if ((a[1] - i * 4) //2 + i) == a[0]:
    ans = True
  elif ((a[1] - i * 2) //4 + i) == a[0]:
    ans = True
if ans:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for turu in range(1,x+1):
    turu = turu
    kame = x - turu
    print(turu,kame)
    if kame*4 + turu*2 == y:
        print("Yes")
        frag = 1
        break
print("No" if flag == 0 else "")

Submission status: Wrong Answer

Solution code:

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

if x * 2 == y or x * 4 == y:
    print ('Yes')
else:

    c = x
    v = y

    while x > 0:
        if y - 4 != 0:
            y -= 2
            x-= 1
        else:
            y -= 4
            x -=1


    if x == y == 0:
        print ('Yes')


    else:
        while c > 0:
            if v - 2 != 0:
                v -= 4
                c-= 1
            else:
                v -= 2
                c -=1

        if c == v == 0:
            print('Yes')
        else:
            print ('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

crane = (4 * X - Y) / 2


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


if is_integer_num(crane) and crane >= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

turu = (4*x-y)//2
# print(turu)

if (turu < 0):
    print("No")
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
animal, foot = map(int, input().split())

total_min = 2 * animal
total_max = 4 * animal

is_yes = False
if total_min <= foot <= total_max:
    for a in range(animal):
        total = (a + 1) * 2 + (animal - (a + 1)) * 4
        if total == foot:
            print("Yes")
            is_yes = True
            break
        elif total < foot:
            break
    if is_yes == False:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

if x>50: 
    print("No")
    sys.exit()
    
    

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x and a>=0 and z%2==0:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout
x,y=map(int,stdin.readline().split())
if y&1:
    print('No')
    exit(0)
t=y//2-1
c=x-t
ans='Yes' if c>0 and t>0 else 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
from numpy.linalg import solve

X,Y = input().split(" ")

left = [[2, 4],
        [1, 1]]
 
right = [int(Y), int(X)]
 
Ans = solve(left, right)

print(Ans)

# 数値が整数（小数点以下が0）か、0より大きいか判定
if Ans[0].is_integer() == True and Ans[1].is_integer() == True and Ans[0] >= 0 and Ans[1] >= 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
x=A[0]
y=A[1]
i=(y-2*x)/2
j=2*x-y/2
if i.is_integer() and j>0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

if(a==y):
    print("Yes")

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

elif(y==(a+b)):
    print("Yes")
    
else:
    print("NO")

Submission status: Wrong Answer

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