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:
X,Y=map(int,input().split())
a=(4*X-Y)//2
if a.is_integer() and a>=0 and a<=100:
  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().split())
print("Yes" if 2*X<=T<=4*X and (4*X-T)%2==0 else "No")

Submission status: Runtime Error

Solution code:
x , y =map(int, input().split())
n = range(100)
for k in n:
  print(k)
  
if y - 2x = 2k:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
x, y = input().split(" ")
x = int(x)
 y = int(y)
print("Yes" if 2*x <= y and y <= 4*x and y%2 == 0 else "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 i in range(X):
    j = X - i 
    if i * 2 + j * 4 == Y:
        ans = ‘Yes’

print(ans)

Submission status: Runtime Error

Solution code:
def main():
    na, nl = (int(i) for i in input().split())
    nc = (4*na - nl) / 2

    pos = nc == int(nc) and nc >= 0 and nc <= x

    if pos:
        print('Yes')
    else:
        print('No')
      
main()

Submission status: Runtime Error

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

pos = (4*x - y) // 2 >= 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n = x * 4
m = n - y
z = m / 2

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

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

flg = 0
for i in range(1, X):
    j = X - i
    ans = i*2 + j * 4

    if Y == ans:
        print("Yes")
        flg = 1
        break

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

Submission status: Runtime Error

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

flg = 0
for i in range(1, 100):
    j = X - i
    ans = i*2 + j * 4

    if ans == Y:
        print("Yes")
        flg = 1
        break

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

Submission status: Runtime Error

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

for i in range(1, 100):
    j = X - i
    ans = i*2 + j * 4

    if ans == Y:
        print("Yes")
        exit(1)

print("No")

Submission status: Runtime Error

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

answer = "No"

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

print(answer)

Submission status: Runtime Error

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

answer = "No"

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

print(answer)

Submission status: Runtime Error

Solution code:
x, *y = map(int, input().split())
C= 2
T= 4
ans="No"
for i in range(x+1):
    b=x-i
    if Ci + Tb == y:
        answer = "Yes"
print(answer)

Submission status: Runtime Error

Solution code:
X,Y = map(input().split()) #input number of animals and legs

crane_legs = 2
turtle_legs = 4

answer = "No"

for i in range(X+1): #X+1 because it will only consider 0,1,2
    remaining = X-i
    if crane_legs*i + turtle_legs*remaining == Y:
        answer = "Yes"
#Loop to check combinations of animals is correct

print(answer)

Submission status: Runtime Error

Solution code:
X,Y = map(input().split()) #input number of animals and legs

crane_legs = 2
turtle_legs = 4

answer = "No"

for i in range(X+1): #X+1 because it will only consider 0,1,2
    remaining=X-i #
    if crane_legs*i + turtle_legs*remaining == Y:
        answer = "Yes"
#Loop to check combinations of animals is correct

print(answer)

Submission status: Runtime Error

Solution code:
#define number of animals and legs
#function for the question can be understood as x=crane+turtles and y=2cranes+4turtles
def equation(numLeg, numAnim):
    for numCrane in range(0, numAnim):
        numTurt=numAnim-numCrane
        totalLeg=4*numTurt+2*numCrane
        if totalLeg==numLeg:
            return[numTurt,numCrane]
    return[None,None]
#input x and y
if __name__ == '__main__':
    x,y=int(input()).split()
    cranes,turtles=equation(y,x)
    if turtles==0:
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
X,Y = map(input().split()) #input number of animals and legs

crane_legs = 2
turtle_legs = 4

answer = "No"

for i in range(X+1): #X+1 because it will only consider 0,1,2
    remaining=X-i #
    if crane_legs*i + turtle_legs*remaining == y:
        answer = "Yes"
#Loop to check combinations of animals is correct

print(answer)

Submission status: Runtime Error

Solution code:
x,y= map(int,input().split())
crane= 2
turtle= 4
ans="No"
for i in range(x+1):
    b=x-i
    if cranei + turtleb == y:
        ans = "Yes"
print(ans)

Submission status: Runtime Error

Solution code:
animals= input()
legs= input()

for i in range (len(animals)):

    if int(legs) % 2 ==0: #to check if it's even then there is a possibility of combination
        print ("yes")
    elif int(legs) % 4 ==0:
        print ("yes")
    elif int(legs) % 2 !=0:
        print ("no")
    elif int(legs) % 4 !=0:
        print ("no")

Submission status: Runtime Error

Solution code:
C,D=input().split('')
C=int(C)
D=int(D)

numb=4*C
if D>numb:
    print("No.")
else:
    print("Yes.")

Submission status: Runtime Error

Solution code:
C, T = map(int, input().split())

#declare the output result no
result = 'No'
for a in range(C + 1):
b = C - a 

#but if the combination is in the cases the result will be yes
if 2 * a + 4 * b == T:
             result = 'Yes'

print(result)

Submission status: Runtime Error

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

X=int(X)
Y=int(Y)

num=4*A

if B>num:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> set_t;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define SUM(v) accumulate(v.begin(),v.end(),lli(0))
#define rev(n,d) for(int i=n;i>=d;i--)
#define FOR0(n) for(int i=0;i<n;i++)
#define FOR(a,n) for(int i=a;i<n;i++)
#define FORQ(a,n) for(int i=a;i<=n;i++)
#define inf 1000000009
#define inff 0x3f3f3f3f
#define sz(a) int((a).size())
#define all(c) c.begin(), c.end()
#define ff first
#define ss second
#define endl "\n"
#define mod 1000000007
#define mem(ar,x) memset(ar,x,sizeof ar)
#define present(container, element) (container.find(element) != container.end())
#define max3(a,b,c) return (lli(a)>lli(b)?(lli(a)>lli(c)?a:c):(lli(b)>lli(c)?b:c))
#define max4(a,b,c,d) return (max3(a,b,c)>lli(d)?(max3(a,b,c)):d)
#define min3(a,b,c) return (lli(a)<lli(b)?(lli(a)<lli(c)?a:c):(lli(b)<lli(c)?b:c))
#define min4(a,b,c,d) return (max3(a,b,c)<lli(d)?(max3(a,b,c)):d)
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<int,pii>ppii;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef vector<pii>vpii;
const int N=100005;
int dr8[]={0,0,1,-1,1,1,-1,-1};
int dc8[]={1,-1,0,0,-1,1,-1,1};
int dr4[]={0,1,-1,0};
int dc4[]={1,0,0,-1};
int n,m,k;
int main(){
	fast
	cin>>n>>m>>k;
	int sx,sy,ex,ey;
	cin>>sx>>sy>>ex>>ey;
	pii came[n][m];
	sx--;sy--;ex--;ey--;
	char a[n][m];
	FOR0(n){
		for(int j=0;j<m;j++) cin>>a[i][j];
	}
	int vis[n][m];
	mem(vis,-1);
	queue<pair<int,int> >q;
	vis[sx][sy]=0;
	q.push({sx,sy});
	mem(came,-1);
	came[sx][sy]={-1,-1};
	while(!q.empty()){
		pii f=q.front();
		q.pop();
		int x=f.ff,y=f.ss;
		for(int i=1;i<=k;i++){
			int yy=y+i;
			if(yy>=m) break;
			if(a[x][yy]=='@') break;
			else if(vis[x][yy]==-1){
				vis[x][yy]=vis[x][y]+1;
				q.push({x,yy});
				came[x][yy]={x,y};
			}
			else if(came[x][yy]==came[x][y]) break;
		}
		for(int i=1;i<=k;i++){
			int yy=y-i;
			if(yy<0) break;
			if(a[x][yy]=='@') break;
			else if(vis[x][yy]==-1){
				vis[x][yy]=vis[x][y]+1;
				q.push({x,yy});
				came[x][yy]={x,y};
			}
			else if(came[x][yy]==came[x][y]) break;
		}
		for(int i=1;i<=k;i++){
			int xx=x+i;
			if(xx>=n) break;
			if(a[xx][y]=='@') break;
			else if(vis[xx][y]==-1){
				vis[xx][y]=vis[x][y]+1;
				q.push({xx,y});
				came[xx][y]={x,y};
			}
			else if(came[xx][y]==came[x][y]) break;
		}
		for(int i=1;i<=k;i++){
			int xx=x-i;
			if(xx<0) break;
			if(a[xx][y]=='@') break;
			else if(vis[xx][y]==-1){
				vis[xx][y]=vis[x][y]+1;
				q.push({xx,y});
				came[xx][y]={x,y};
			}
			else if(came[xx][y]==came[x][y]) break;
		}
	}
	cout<<vis[ex][ey];
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=input()
y=input()
if 2*x <= y <= 4*x and 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):
  if(y-4)>0:
    y=y-4
  elif y-2>0:
    y=y-2
    
if y==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
X,Y = map(int,input().split())
if y%2 == 0:
  y = Y//2
else:
  print('No')
  exit(0)

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
X,Y = input().split()
v = Y-(2*X)
if v<0 or v%2==1:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split())
ans="No"
if a in range(x+1):
  b=x-a
  a*2+b*4==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(),split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
XY = input()
X = int,(XY.split([0]))
Y = int,(XY.split([1]))

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

Submission status: Runtime Error

Solution code:
X, Y = map(int, input().split())
 
ans = 'No'
if 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'
if a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
        print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
p = []
ans = 0
z=x+1

for i in range(x):
    p.append(4)

for a in range(z):
    if sum(p)==y:
        ans = 1
        break
    else:
        p.remove(4)
        p.append(2)

if ans == 1:
    print('Yes')
else:
    if (y==2)&(x==1):
        print('Yes')
    if (y==4)&(x==1):
        print('Yes')
    else :
        print('No')

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
p = []
ans = 0
z=x+1

for i in range(x):
    p.append(4)

for i in range(z):
    if sum(p)==y:
        ans = 1
        break
    else:
        p.remove(4)
        p.append(2)

if ans == 1:
    print('Yes')
else:
    if (y==2)&(x==1):
        print('Yes')
    if (y==4)&(x==1):
        print('Yes')
    else :
        print('No')

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
p = []
ans = 0

for i in range(x):
    p.append(4)

for i in range(x+1):
    if sum(p)==y:
        ans = 1
        break
    else:
        p.remove(4)
        p.append(2)

if ans == 1:
    print('Yes')
else:
    if (y==2)&(x==1):
        print('Yes')
    elif (y==4)&(x==1):
        print('Yes')
    else :
        print('No')

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
X = a[1]
Y = a[2]

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

Submission status: Runtime Error

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

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().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:
def abc2(x,y):
    if y%2!=0:
        return print("No")
    kame = (y//2)-x
    if (kame>=0)&(kame<=x):
        return print("Yes")
    else:
        return print("No")
x,y = map(int,input().split())
abs2(x,y)

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().split())
if y%2!=0:
    print("No")
kame=(y//2)-x
tsuru = (-y//2)+2x
if kame + tsuru == x:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
x,y = map(intinput()split())
a = 4x-y
if a/2 = a%2:
  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().split())

ans = 'No'
for i range(x+1):
  if (x*2 + (x-i)*4) == y:
    ans='Yes'
    break
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:
A=list(map(int,input().split()))
a=[]
for n in range(0,a[0]+1):
    m=A[0]-n
    if 2*n+4*m=A[1]:
      a.append(1)
    
if 1 in a:
  print('yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
A=list(map(int,input().split()))
a=[]
for n in range(0,101):
  for m in range(0,101):
    if n+m=A[0] & 2*n+4*m=A[1]:
      a.append(1)
    else:
      a.append(0)
      
if 1 in a:
  print('yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
import numpy as np
import math
n = int(input())
x = []
y = []
for i in range(n):
  x_, y_ = list(map(int, input().split()))
  x.append(x_)
  y.append(y_)
val = 0
for i in range(n):
  for j in range(i+1, n):
    val += np.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

ans = val/math.factorial(n) * math.factorial(n-1) * 2
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

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

for i in range(x + 1):
  for j in range(x + i):
    if i * 2 + j * 4 == y and i + j == X:
      print('yes')
      sys.exit()
 
print('no')

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
if (y-x) > =x:
  print "Yes"
else:
  print "No"

Submission status: Runtime Error

Solution code:
x, y = map(int, input())
if (y-x) > =x:
  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'
7 print(ans)

Submission status: Runtime Error

Solution code:
X, Y = list(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 = list(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().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= int(input())
y=int(input())

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

Submission status: Runtime Error

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

if (1 <= X <= 100) and (1 <= Y <= 100):
  if isinstance(( Y - X ) / 2, int) and isinstance((Y - X) / -2, int)
  	print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if y % 2 != 0:
  print('No')
elif y - 2 * x < 0:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

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

k=0
for i in range(a):
    for j in range(a):
        # if a<=100 && a>=1 && b>=1 && b<=100: 
            if (i*2+j*4) ==b and i+j==a :
                print("yes")
                k=1
if k==0:
    print("no")

Submission status: Runtime Error

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

a = x[0]*2 - x[1]/2
b = -x[0]/2 + x[1]/2

if a>=0 and b>= 0:
	if(a.isinteger() and b.isinteger()):
		print("yes")
	else;
		print("no")
else:
	print("no")

Submission status: Runtime Error

Solution code:
x = list(map(int, xin))

a = x[0]*2 - x[1]/2
b = -x[0]/2 + x[1]/2

if a>=0 and b>= 0:
	print("yes")
else:
	print("no")

Submission status: Runtime Error

Solution code:
B = [int(i) for i in input().split()]
S = 0
if 1 <= B[0] <= 100 and 1 <= B[0] <= 100:
    if B[1]%2 == 0 or B[1]%4 == 0: 
        if B[0] >= B[1]/2:
            if B[0] >= B[1]/4:
            S = "Yes"
        else:
            S = "No"
    else:
        s = "No"
else:
    S = " choose number between 1 and 100"
print(S)v

Submission status: Runtime Error

Solution code:
B = [int(i) for i in input().split()]

if 1 <= B[0] <= 100 and 1 <= B[0] <= 100:
    if B[1]%2 == 0 or B[1]%4 == 0: 
        if B[0] >= B[1]/2 or B[0] >= B[1]/4:
            S = "Yes"
        else:
            S = "No"
    else:
        s = "No"
else:
    S = " choose number between 1 and 100"
print(S)

Submission status: Runtime Error

Solution code:
B = [int(i) for i in input().split()]
if B[1]%2 == 0 or B[1]%4 == 0 and 1 <= B[0] <= 100:
    if B[0] >= B[1]/2 or B[0] >= B[1]/4:
        S = "Yes"
    else:
        S = "No"
print(S)

Submission status: Runtime Error

Solution code:
B = [int(i) for i in input().split()]

if B[0] == 1:
    if B[1] == 2 or B[1] == 4:
        S = "Yes"
    else:
        S = "No"
elif B[1]%2 == 0 or B[1]%4 == 0 and 1 < B[0] <= 100:
    if B[0] >= B[1]/2 or B[0] >= B[1]/4:
        S = "Yes"
    else:
        S = "No"
print(S)

Submission status: Runtime Error

Solution code:
B = [int(i) for i in input().split()]

if B[0] == 1 and B[1] == 2 or B[1] == 4:
    S = "Yes"
elif B[0] < 1:
    S= "choose a positive number"
elif B[1]%2 == 0 and B[1]%4 == 0 and B[0] <= 100:
    if B[0] >= B[1]/2 or B[0] >= B[1]/4:
        S = "Yes"
    else:
        S = "No"
print(S)

Submission status: Runtime Error

Solution code:
 X, N = map(int, input().split())
 p = list(map(int, input().split()))
 for d in range(X + 1):
 for s in [-1, +1]:
 a = X + s * d
 if p.count(a) == 0:
 print(a)
 exit(0)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
X,Y = map(list, input().split())

for i range(X+1):
  a = X-i
  sum = 2X + 4a
  if sum == Y:
    print('Yes')
    break
  else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
X,Y = map(list, input().split())

for i range(X):
  a = X-i
  sum = 2X + 4a
  if sum == Y:
    print('Yes')
    break
  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 = 0

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y = map(int input().split())
a = -y+4x
b = y-2x
if(a%2==0 and b%2==0):
  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 = input()
y = input()
X = int(x)
Y = int(y)
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 = int(input())
y = int(input())
for i in range(x):
    if 4 * x - 2 * i == y:
        print("Yes")
        exit()
    else:
        continue
print("No")

Submission status: Runtime Error

Solution code:
kazu, ashi = map(int, input().split())

if (ashi - 2*kazu) % 2 == 0:
    kame = (ashi - 2*kazu) // 2
else:
    print("No")
if kazu - kame >= 0 and kame >= 0:
    print("Yes")
else:
    print("No")

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:
kazu, ashi = map(int, input().split())

if (ashi - 2*kazu) % 2 == 0:
    kame = (ashi - 2*kazu) // 2
else:
    print("No")
if kazu - kame >= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

for i in range(input_line[1]):
  print(input_line[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x=int(input())
y=int(input())
if y%2!=0:
    print("No")
    exit()
import math
z=math.log2(y)
if z<=x:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
x=int(input())
y=int(input())
if y%2!=0:
    print("No")
    exit(0)
import math
z=math.log2(y)
if z<=x:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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 = 'T'

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

X= num[0]
Y =num[1]
ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    braek;
print(ans)

Submission status: Runtime Error

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

X= num[0]
Y =num[1]

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

Submission status: Runtime Error

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

X= num[0]
Y =num[1]

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

Submission status: Runtime Error

Solution code:
val1 = input()
val2 = input()
if(val2 % 2 == 0 and val1*2 < val2 < val1*4):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
turtle = 4
crane = 2

x = input("number of animals")
y = input("number of legs")

if y == (turtle + crane * x):
  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= int(input()),y= int(input())
if (y/x)<2 or (y/x)>4:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

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