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: Runtime Error

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

# check
if Y in set([sum(p) for p in set(product([2, 4], repeat=X))]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#a+b=x
#2a+4b=y
#2a=4x-y

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

Submission status: Runtime Error

Solution code:
import math
T,L = map(int,input())
n = (4*T - L)/2
if math.floor(n) == math.ceil(n):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import accumulate
from collections import Counter
n = int(input())
T = []
for _ in range(n):
    T.append(int(input()))
T.sort()
print(sum(accumulate(T)))
dic = Counter(T)
ans = 1
mod = 10**9+7
for i in dic.values():
    for j in range(1,i+1):
        ans *= j
        ans %= mod
print(ans)

Submission status: Runtime Error

Solution code:
1<= x <= 100
1<= y <= 100
if 4x <= y:
  print("No")
elif 2x >= y:
  print("No")
elif y % 2 == 1:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X, Y = map(int, input().split())
2 ans = 'No'
3 for a in range(X + 1):
4 b = X - a
5 if 2 * a + 4 * b == Y:
6 ans = 'Yes'
7 print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x = int(input())
y = int(input())

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split())
large=x*4;
small=x*2;
flag=False;
for i in range(small,large+1,2):
  if i==y:
    flag=true;
    break;
if flag :
  print("yes");
else :
  print("no");

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A = list(map(int, input().split())) 
quantity = A[0]
number_of_legs = A[1]
j1 = check_kame(quantity, number_of_legs);
j2 = check_tsuru(quantity, number_of_legs);
if (j1 == j2):
  print("No")
else 
  print("Yes")

def check_kame(quantity, number_of_legs):
  number_of_kame = int(number_of_legs/4)
  if(number_of_kame <= quantity):
    j = 1;
  else if ((number_of_legs - number_of_kame*4)%2 == 0):
    j = 1;
  else :
    j = 0;
  return j1;  
    
def check_tsuru(quantity, number_of_legs):
    number_of_turu = int(number_of_legs/2)
  if(number_of_kturu <= quantity):
    j = 1;
  else if ((number_of_legs - number_of_kame*2)%4 == 0):
    j = 1;
  else :
    j = 0;
  return j2;

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y = map(int,input().sprit())
k = "NO"
for i in range(x+1):
  b=x-i
  if i*4+b*2==y:
    k="YES"
print(k)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
#include <set>
#include <queue>
#include <list>
using namespace std;
typedef long long ll;

void solve() {
	int x, y; cin >> x >> y;
	for (int i = 0; i <= x; i++) {
		if ((y - 2 * i) % 4 == 0 && (y - 2 * i) / 4 + i == x) {cout << "Yes"; return ;}
	}
	cout << "No";


}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// int t; cin >> t;
	// while (t--)
	solve();

}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print("Yes" if (lambda x: x[0] * 2 <= x[1] <= x * 4)(list(map(int,input().split()))) else "No")

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
z = 2*x + y/2
if (z - floor(z) == 0):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

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

Submission status: Runtime Error

Solution code:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X[0] > 100 or X[1] > 100:
  print(ans)
  sys.exit()
if X[1] > X[0]*4 or X[1] < X[0]*2:
  print(ans)
  sys.exit()
if X[1] % 2 == 1:
  print(ans)
  sys.exit()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
pyenv shell 3.8.0
dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.1.6.dylib
  Referenced from: /usr/local/bin/tmux
  Reason: image not found
[2]    51266 abort      tmux
% pyenv shell 3.8.0                                                   ~/Documents/sub-programming/atcoder
pyenv: shell integration not enabled. Run `pyenv init' for instructions.
% python 170a.py                                                      ~/Documents/sub-programming/atcoder
0 2 3 4 5
Traceback (most recent call last):
  File "170a.py", line 3, in <module>
    if h[i] == 0:
IndexError: list index out of range
% python 170a.py                                                      ~/Documents/sub-programming/atcoder
0 2 3 4 5
1
% python                                                              ~/Documents/sub-programming/atcoder
Python 3.8.0 (default, Dec  6 2019, 13:22:27) 
[Clang 8.0.0 (tags/RELEASE_800/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> int(2,1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: int() base must be >= 2 and <= 36, or 0
>>> int(2.1)
2
>>> int(2.4)
2
>>> type(2.1)
<class 'float'>
>>> math.ceil(2.1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'math' is not defined
>>> 1.ceil()
  File "<stdin>", line 1
    1.ceil()
      ^
SyntaxError: invalid syntax
>>> 
KeyboardInterrupt
>>> eix
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'eix' is not defined
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> 
% python 170b.py                                                      ~/Documents/sub-programming/atcoder
  File "170b.py", line 5
    print('Yes'):
                ^
SyntaxError: invalid syntax
% python 170b.py                                                      ~/Documents/sub-programming/atcoder
3 8
Yes
%                                                                     ~/Documents/sub-programming/atcoder

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

if __name__ == "__main__":
  for line in sys.stdin:
    anis, legs = line.split(' ')
    if legs % 2 == 1 or legs > anis * 4 or legs < anis * 2:
      print("No")
    else:
      print("Yes")

Submission status: Runtime Error

Solution code:
X = list(map(int, input().split()))
if X[0] > 100 or X[1] > 100:
  no_print
if X[1] > X[0]*4 or X[1] < X[0]*2:
  no_print
if X[1] % 2 == 1:
  no_print

number_check
  
def no_print():
  print(No)
  exit
    for I in list(range(1,100,1))

def number_check():
  turtle = X[0]
  crane = 0
  for (int i==0; i <= X[0]: i++):
    result = turtle * 4 + crane * 2 
    if result > X[1]:
      crane += 1
      turtle -= 1
    if result == X[1]:
      print(Yes)
      exit
    if result < X[1]:
      turtle += 1
      crane -= 1

Submission status: Runtime Error

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

print('No

Submission status: Runtime Error

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

crain = (4 * X - Y) / 2
turtle = (Y - 2 * X) / 2

if (crain.is_integer() and crain >= 0) and ( turtle.is_integer() and turtle >= 0):n*2))
    print ("Yes")
else:
    print ("No")

Submission status: Runtime Error

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

for a in range(0, x+1):
    b = x - a
    if a*2 + b*4 == y:
        ans = 'Yes'
        break

print(ans)

Submission status: Runtime Error

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

if Y%2 == 1:
    print('No')
    exit()
else:
    if 2X <= Y <= 4*X:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
X = input()
Y = input()
T = false
for i in range(1,X+1):
  p = X-i
  J= 2*i + 4*p
  if J =Y:
    T = true
if T == true:
  print("Yes")
  else print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i = 0; i< (n); i++)
#define REP(i,n) for (int i = 1; i<= (n); i++)
#define MAX_MOD 1000000007LL
#define MOD 998244353LL
const long double PI = acos(-1);
using ll = long long;
using ld = long double;
using namespace std;

int main() {
    int x, y;
    cin >> x >> y;
    for (int i = 0; i <= (x); i++){
        if (y == i*2 + (x-i)*4) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def inp():
    ls=list(map(int,input().split()))
    return ls
x,n=map(int,input().split())
ls=inp()
ls.sort()
if n==0:
    print(x)
    exit(0)
else:
    ans=0
    d=1000000000
    for i in range(1,101):
        if i in ls:
            continue
        tmp=abs(x-i)
        if tmp<d:
            d=tmp
            ans=i
    print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 'No'

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

Submission status: Runtime Error

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

ans = 'No'

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main ()
{
	int x, y; cin >> x >> y;
	if (y <= 4*x and 2*y <= x and y % 2 == 0)
		cout << "Yes" << '\n';
	else
		cout << "No" << '\n';
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if (b-2*a)%2==0:
    if (b-2*a)=0:
      if (4*a-b) = 0:
        print('No')
        break
    if (b-2*a)<0:
      print('NO')
      break
    elif (4*a-b)<0:
      print('NO')
      break
    elif(4*a-b)%2==0:
      print('YES')
      break
    else:
      print('No')
      break
    
else:
  print('No')
  break

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a,l=map(int,input().split())
s=0
if l/a==2 or l/a==4:
	print("YES")
else:
	t,f=0,0
	for i in range(1,a+1):
		t+=i*2
		f+=i*4
if f>l:
	while f!=l:
		f=f-2
	if f==l:
		print("YES")
	else:
		print("NO")
else:
	print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

x, y = [int(x) for x in input().split()]
n = (4 * x - y) / 2
if n < 0 or n > y:
    print("No")
    sys.exit()
if 2*n + 4(x-n) == y:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n, leg = map(int,input().split())
print("Yes") if leg//4 != n else print("No")n, leg = map(int,input().split())
four= leg//4
if (n-four)%2==0 :
    print("Yess")
elif leg//4 == n or leg//2 == n:
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict
 
x,y = map(int,input().split())
 
for i in range(1, x+1):
    # 足の数
    f = 2 * i + 4 * (x - i)
    if f == y:
        print('Yes')
        sys.exit()
	elif i==x: 
    	print('No')

Submission status: Runtime Error

Solution code:
a=34

if a==int
print(6)

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
crain = (4 * N - M) / 2
R = N - int(crain)
if crain.is_integer():
  if crain >= 0　and R > 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a = input().split(" ")
l = int(a[0])
s = int(a[1])
if (s - (2 * l)) % 2 == 0 :
    r = (s - (2 * l)) * 2
if (s - r) % 2 == 0 :
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
crain = (4 * N - M) / 2
if crain.is_integer():
  if crain >= 0　and (N - int(crain)) > 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
def solve(X, Y):
    import sympy as sp
    sp.init_printing()
    sp.var('a, b')
    eq1 = sp.Eq(2 * a + 4 * b, Y)
    eq2 = sp.Eq(a + b, X)
    res = sp.solve([eq1, eq2], [a, b])
    x = res[a]
    y = res[b]
    if x == int(x) and y == int(y) and x >= 0 and y >= 0:
        print('Yes')
    else:
        print('No')

X, Y = map(int, open(0).read().split())
solve(X, Y)

Submission status: Runtime Error

Solution code:
import sympy

def main():
    X,Y=(int(num) for num in input().split())

    if X <= 0 or X >100 or Y <= 0 or Y >100:
        print('NO')
        return

    a = sympy.Symbol('a')
    b = sympy.Symbol('b')

    equation1 = a + b - X
    equation2 = 2*a + 4*b - Y

    c,d=list(sympy.solve([equation1, equation2]).values())

    if c < 0 or  d < 0:
        print('NO')
        return
    elif c.is_Integer and c >= 0 and d.is_Integer and d >= 0:
        print('YES')
        return
    else:
        print('NO')

main()

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
crain = (4 * N - M) / 2
if crain.is_integer():
  if crain >= 0　and N - int(crain) > 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if Y < X*2 :
  print("NO")
  eit()
  
if Y % 2 == 0:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(a):
    if (a-i)*2+(i)*4 == b:
        print('Yes')
        break
  
 print('No')

Submission status: Runtime Error

Solution code:
turu = 2
kame = 4
flag =0

for x in range(a + 1):
    for y in range(a + 1):
        if turu * x + kame * y == b and x + y <= a:
            flag += 1

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

Submission status: Runtime Error

Solution code:
import sympy

def main():
    X,Y=(int(x) for x in input().split())

    if X <= 0 or X >100 or Y <= 0 or Y >100:
        print('NO')
        return

    a = sympy.Symbol('a')
    b = sympy.Symbol('b')

    equation1 = a + b - X
    equation2 = 2*a + 4*b - Y

    c,d=list(sympy.solve([equation1, equation2]).values())

    if c < 0 or  d < 0:
        print('NO')
        return
    elif c.is_Integer and c >= 0 and d.is_Integer and d >= 0:
        print('YES')
        return
    else:
        print('NO')

main()

Submission status: Runtime Error

Solution code:
def X(t,k):
  return t + k
def Y(t,k):
  return 2t + 4k
if 1<= X<= 100 and 1<= Y <= 100 and int:
  return yes
else:
  return no

Submission status: Runtime Error

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



result="No"
sum_=0
for i in range(A[0]):
  
  if A[1] - sum_ >= 4:
    sum_+=4
  elif A[1] - sum_ >= 2:
    sum +=2
    
  if sum_ == A[1]:
    result="Yes"
    
  
print(result)

Submission status: Runtime Error

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

#print(x, y)
leg_turtle = 4
leg_clane = 2

if y > x * leg_turtle:
    print("No")
    exit()
elif y < leg_clane * x:
    print("No")
    exit()


import pulp

#線形計画の定義
problem = pulp.LpProblem('clane_turtle', pulp.LpMaximize)

#変数の定義
clane = pulp.LpVariable('clane', 0, 100, 'Integer') 
turtle = pulp.LpVariable('turtle', 0, 100, 'Integer') 

#目的関数の定義
problem += 2 * clane + 4 * turtle

#制約条件の定義
problem += clane + turtle == x
problem += 2 * clane + 4 * turtle <= y

#解く
status = problem.solve()
#print(pulp.LpStatus[status])
c = clane.value()
t = turtle.value()
res_1 =  2 * c + 4 * t
res_2 = c + t
#print(c, t)
if res_1 == y and res_2 == x:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
X = int(input())
Y = int(input())

if Y < X * 2:
    print('No')
elif Y > X * 4:
    print('No')
elif Y % 2 == 1:
    print('No')
elif X == 0:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
import sympy

def main():
    X,Y=(int(x) for x in input().split())

    a = sympy.Symbol('x')
    b = sympy.Symbol('y')

    equation1 = a + b - X
    equation2 = 2*a + 4*b - Y

    c,d=list(sympy.solve([equation1, equation2]).values())

    if c.is_Integer and c >= 0 and d.is_Integer and d >= 0:
        print('YES')
    else:
        print('NO')

main()

Submission status: Runtime Error

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

a=(4*X-Y)/2

if a.is_integer() and a>0:
    q=1
    print("Yes")

a=(8*X-Y)/4

if q==0:
    if a.is_integer() and a>0:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(X):
  for j in range(X):
    if 2*i+4*j == Y:
      print("Yes")
      exit()

print("No")

Submission status: Runtime Error

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 Xand (Y-2*X)/2==1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
X = int(input("Please input X:\n"))
Y = int(input("Please input Y:\n"))
Z = Y - 2*X

for i in range(1,51):
  if Z == 2 * i:
    print('Yes')
    break

  elif (i==50) and (Z != 2*i):
    print('No')

Submission status: Runtime Error

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

add = 0
flug =0

for i in range(X):
    add = i*4 + (X-i)*2
    if add == Y:
        print('Yes')
        flag = 1
        break

if flag == 0:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X,Y = map(int,input().split())
c = 4*x - y
if(c>=0 and c%2==0):
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

sum = 0
flug =0

for i in range(X):
    sum = i*4 + (X-i)*2
    if sum == Y:
        print('Yes')
        flag = 1
        break

if flag == 0:
    print('No')

Submission status: Runtime Error

Solution code:
x = input().split(' ')


def rcv(len, sum):
  if len == int(x[0]):
    return sum == int(x[1])
  elif sum > int(x[1]):
    return False
  else:
    return rcv(len+1, sum+2) or rcv(len+1, sum+4)

if int(x[1] / 4)>0:
  result = False
else:
  result = rcv(0, 0)
if result:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
int X,Y;
cin>>X>>Y;
if(Y%2==0&&Y>=2*X&&Y<=4*X){
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}

Submission status: Runtime Error

Solution code:
x = input().split(' ')


def rcv(len, sum):
  if len == int(x[0]):
    return sum == int(x[1])
  elif sum > int(x[1]):
    return False
  else:
    return rcv(len+1, sum+2) or rcv(len+1, sum+4)

if int(x[1] / 4)>0:
  result = false
else:
  result = rcv(0, 0)
if result:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
l=list(map(int,input().split()))
n=l[0]
legs=l[1]
(2*a)+(2*(n-a))==legs
if(l[1]%2!=0):
    print("No")
if(l[1]%2==0 and l[0]*4>=l[1]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x+y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Submission status: Runtime Error

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')
        breake
    d = b-i
    if X*i + Y*d == c:
        print('Yes')
        break
    elif i == b-1:
        print('No')

Submission status: Runtime Error

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: Runtime Error

Solution code:
import sys
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: Runtime Error

Solution code:
def nums (X,Y):
   B = (X*4-Y)/(4-2)
    D = X-B
    if B + D == X and Y == (B*2 + D*4):
          print("True")
    else:
           print("False")

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1)
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Submission status: Runtime Error

Solution code:
import sympy

num = list(map(int, input().rsplit()))

x = sympy.Symbol("x")

expr = 2 * x + 4 * (num[0] - x) - num[1]
ans = sympy.solve(expr)

ans = str(ans)

if "/" in ans or "-" in ans:
    print("No")
elif ans == "0":
    print("Yes")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
if (a[0] * 4) >= a[1] and (a[0] * 2) <= a[1] and A[1] % 2 == 0:
    print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

c = 0

while x >= 0 :
    if c * 2 + x * 4 == y :
        break 
    c += 1
    x -= 1
else :
    print(No)

print(Yes)

Submission status: Runtime Error

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: Runtime Error

Solution code:
import sympy

num = list(map(int, input().rsplit()))

x = sympy.Symbol("x")

expr = 2 * x + 4 * (num[0] - x) - num[1]
ans = sympy.solve(expr)

ans = str(ans)

if "/" in ans or "-" in ans:
    print("No")
else:
    print("Yes")