Problem:


Score : 200 points

Problem Statement

There are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.

Takahashi says: "there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.

Constraints

1 \leq X \leq 100

1 \leq Y \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.

Sample Input 1

3 8

Sample Output 1

Yes

The statement "there are 3 animals in total in the garden, and they have 8 legs in total" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.

Sample Input 2

2 100

Sample Output 2

No

There is no combination of numbers of cranes and turtles in which this statement is correct.

Sample Input 3

1 2

Sample Output 3

Yes

We also consider the case in which there are only cranes or only turtles.



Sample input:
3 8


Sample output:
Yes

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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

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


# region fastio

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


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

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

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 'No'

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## coding: UTF-8
X, Y = map(int,input().split())


ans = 'Yes'

if(Y % 2 != 0):
    ans = 'No'

a = 2*X
b = 4*X
if(Y < a):
    ans = 'No'
if(Y > b):
    ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
x, y = map(int, input().split())
for i in range(x+1):
    if 2*i+4*(x-i) == y:
        print("Yes")
        quit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

X, Y = MAP()

c = (Y-2*X)/2

if c%1 == 0 and 0 <= c <= X:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
for turu in range(1000):
    for kame in range(1000):
        if turu+kame == X and 2*turu+4*kame == Y:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
X, Y = map(int, input().split())
for i in range(0, X + 1):
    if i * 2 + (X - i) * 4 == Y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


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

Submission status: Accepted

Solution code:
def solve(x, y):
    for i in range(x + 1):
        if 2 * x + 2 * i == y:
            return "Yes"
    return "No"


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


def test():
    assert solve(3, 8) == "Yes"
    assert solve(2, 100) == "No"
    assert solve(1, 2) == "Yes"


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

Submission status: Accepted

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

f = 0
for i in range(x+1):
    # print(x*2+(x-i)*4)
    if i*2+(x-i)*4 == y:
        f = 1

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

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

Submission status: Accepted

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

for i in range(0,101):
    for j in range(0, 101):
        if i+j == X and i*2+j*4 == Y:
            print('Yes')
            exit(0)
print('No')

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

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

def main():
    x,y = readInt()
    for i in range(x+1):
        if i*2+(x-i)*4==y:
            print("Yes")
            return
    print("No")
    return

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for A in range(X+1):
    B = X-A
    num = A*2 + B*4
    if num == Y:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

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


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

x,y = mp()
for i in range(101):
    for j in range(101):
        if i + j == x and 2*i + 4*j == y:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

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

for i in range(x + 1):
    j = x - i

    if 2 * i + 4 * j == y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.buffer.readline
def main():
    x, y = map(int, input().split())
    for i1 in range(x + 1):
        if i1 * 2 + (x - i1) * 4 == y:
            print('Yes')
            sys.exit()
    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
X,Y=map(int,input().split())
flg=False
for i in range(X+1):
    if 2*(X-i)+4*i==Y:
        flg=True
        

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

Submission status: Accepted

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


ans = 'No'
for k in range(X+1):

  t = X-k
  if k * 4 + t * 2 == Y:
    ans = 'Yes'
    
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X, Y = map( int, input().split())
    if Y < X*2:
        print("No")
        return
    if (Y-X*2)%2 == 0:
        if (Y-X*2)//2 <= X:
            print("Yes")
            return
    print("No")
        
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True

    @staticmethod
    def fact(N):
        res = {}
        tmp = N
        for i in range(2, int(N ** 0.5 + 1) + 1):
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if cnt > 0:
                res[i] = cnt
        if tmp != 1:
            res[tmp] = 1
        if res == {}:
            res[N] = 1
        return res


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    X, Y = Scanner.map_int()
    if Y % 2 == 1:
        return False
    if 2 * X <= Y <= 4 * X:
        return True
    return False


def main():
    # sys.stdin = open("sample.txt")
    # T = Scanner.int()
    # for _ in range(T):
    #     solve()
    print('YNeos'[not solve()::2])
    # solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
minAsi = X * 2
maxAsi = X * 4

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

Submission status: Accepted

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

ans=True
if y<2*x or y>4*x:
    ans=False
if y%2!=0:
    ans=False

print("Yes" if ans else "No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62


YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):

    if Y%2:
        print(NO)
        return
    a = Y//2 - X
    if X- a < 0:
        print(NO)
        return
    if  a < 0:
        print(NO)
        return
    print(YES
          )
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(X, Y)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
X, Y = map(int, input().split())
flag = False
for i in range(0, X+1):
    if i * 4 + (X-i) * 2 == Y:
        flag = True
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
x,y = map(int,input().split())
if y % 2 == 0 and y >= 2*x and y <= 4*x:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    X, Y = map(int, input().split())
    a = 2 * X
    for i in range(2*X, 4*X+1, 2):
        if i == Y:
            print("Yes")
            break
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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: Accepted

Solution code:
def main():
    X, Y = list(map(int, input().split()))
    for i in range(X + 1):
        if i * 4 + (X - i) * 2 == Y:
            return True
    return False


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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, S = mi()

if not S % 2 and N * 4 >= S >= N * 2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

tsuru = 0
kame = x

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

print('No')

Submission status: Accepted

Solution code:
def main():
    X, Y = map(int, input().split())
    if Y % 2 == 1:
        return False
    if 4*X >= Y >= 2*X:
        return True
    return False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def main():
    x, y = map(int, input().split())
    if y % 2 == 0 and y // 2 - x >= 0 and 2 * x - y // 2 >= 0:
        print("Yes")
    else:
        print("No")
    

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

for i in range(x+1):
    kame=i
    tsuru=x-i
    # print(kame,tsuru)
    if kame*4+tsuru*2==y:
        print("Yes")
        quit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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