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:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')
AtoZ = "abcdefghijklmnopqrstuvwxyz"

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

X,Y = IL()

for i in range(X+1):
  j = X-i
  if j>=0 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 == 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 and Y<=X*4 and X*2<=Y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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 = [int(n) for n in input().split()]

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ng = True
for i in range(x+1):
    if i*2+(x-i)*4==y:
        ng = False
print("YNeos"[ng::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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')
        exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

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

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


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

if ans == -1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
nii=lambda:map(int,input().split())
lnii=lambda:list(map(int,input().split()))

x,y=nii()

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

print('No')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print('Yes' if x*4>=y and x*2<=y and y%2==0 else '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 = [int(x) for x in input().split()]


mn = X * 2
mx = X * 4
if Y % 2 == 0 and mn <= Y <= mx:
    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:
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:
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

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

flag = False
for i in range(101):
    for j in range(101):
        if i+j==X and 2*i+4*j==Y:
            flag = True
            break
    else:
        continue
    break

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
X, Y = list(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())
for i in range(x + 1):
    num = 4 * i + (2 * (x - i))
    if num == y:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
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 = [int(i) for i in 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())

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

Submission status: Accepted

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



low = x*2
up = x*4

if low <= y <= up and y%2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

x,y = map(int,stdin.readline().rstrip().split())

for i in range(x+1):
    j = x-i
    if i*2+j*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 2 * i + 4 * (x - i) == y:
        print("Yes")
        break
else:
    print("No")

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')
        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())

for i in range(100):
    for j in range(100):
        if i*4+j*2==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(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:
x,y = map(int,input().split())
if y%2==0 and x*2<=y<=x*4:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X,Y = [int(_n) for _n in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

for kame in range(100):
   for turu in range(100):
      if kame + turu == x and kame * 4 + turu * 2 == y:
         print("Yes")
         exit()
print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)

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

def solve(X: int, Y: int):
    ret = NO
    for i in range(X + 1):
        if 4 * i + 2 * (X - i) == Y:
            ret = YES
    print(ret)
    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:
X,Y=map(int, input().split())

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


# 2darray [[0] * 4 for i in range(3)]

Submission status: Accepted

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

    for crane in range(X + 1):
        turtle = X - crane
        if Y == crane * 2 + turtle * 4:
            print('Yes')
            return

    print('No')


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# じょえチャンネルおもしろいよ～～～
# https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ

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

Submission status: Accepted

Solution code:
def main():
    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")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
print("YNeos"[not any(i*2+(X-i)*4==Y for i in range(X+1))::2])

Submission status: Accepted

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

if b >= a*2 and b <= a*4 and b%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())
for i in range(100):
    for j in range(100):
        if i+j == x and 2*i + 4*j == y:
            print("Yes")
            exit()
print("No")

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

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 = (int(num) for num in input().split())
if y >= x * 2 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):
    a = 2*i + 4*(x-i)
    if a == y:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

x, y = list(map(int, sys.stdin.buffer.readline().split()))

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
from decimal import *
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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: 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:
    print('Yes')
   
  else:
    a += 1
    
if a==X
    
    
if a   ==1:
  print('No')

Submission status: Runtime Error

Solution code:
x, n = map(int, input().split())
s = []
if n == 0:
  print(x)
else:
  a = sorted([i for i in list(map(int, input().split())) if i != x])
  for i in range(n):
    s.append(abs(a[i] - x))
  b = a[s.index(min(s))]
  print(b)

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:
x, y = map(int, input().split())
for i in range(0, x+1):
  a.append(2 * i + 4 * (3 - i))
print("Yes" if y in a else "No")

Submission status: Runtime Error

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

for i in range(101):
  for j in range(101):
    if i+j == x and 2*i + 4*j == y:
		ans = True

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

Submission status: Runtime Error

Solution code:
X = int(input())
Y = int(input())
flag =0
for crane in range(X + 1):
  if (Y - crane*2 - (X-crane)*4 ) == 0:
    print("Yes")
    flag =1
    break
if flag == 0:
    print("No")

Submission status: Runtime Error

Solution code:
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()


X = int(input())
Y = int(input())
Turtle = (Y - 2*X ) / 2
Crane = X - Turtle
if Turtle >= 0 and Crane >= 0 and is_integer(Turtle) and is_integer(Crane):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
X = int(input())
Y = int(input())
if (Y-2*X) % 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):
  2*i + 4*(x-i) == y:
    print("Yes")
    exit()
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if y % 2 == 1:
    print('No')
else:
    for i in range(x + 1):
        foot = i * 2 + (x - i) * 4
        if foot == y:
            print('Yes')
            exit()
    print('No')

Submission status: Runtime Error

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

print('No')

Submission status: Runtime Error

Solution code:
input_line = input().split(" ")
X = int(input_line[0])
Y = int(input_line[1])
Pat = 0
for i in range(X + 1):
  	C = i
	T = X - i
    Cf = C * 2
    Tf = T * 4
    F = Cf + Tf
	if Y == F:
      Pat = Pat + 1
if Pat >= 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

m = 0
while m < n+1:
	if m*4 + (n-m)*2 == t:
      print('Yes')
      break
      
    m += 1
    
if m == (n+1):
  print('No')

Submission status: Runtime Error

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import Counter
from math import prod

def sieve_of_eratosthenes(n):
  primes = [2]
  cands = list(range(3, n+1, 2))
  while len(cands) != 0:
    prime = primes[-1]
    cands = list(filter(lambda x:x%prime != 0, cands))
    if len(cands) == 0:
      break
    primes.append(cands.pop(0))
  return primes

def factorize(n):
  primes = []
  for prime in sieve_of_eratosthenes(int(n**0.5)):
    while n%prime == 0:
      primes.append(prime)
      n//=prime
  if n > 1:
    primes.append(n)
  return primes

def main():
  n = int(input())
  factors = factorize(n)
  sum_of_factors = prod([sum([x ** i for i in range(cnt+1)]) for x, cnt in Counter(factors).items()]) - n
  if n == sum_of_factors:
    print('Perfect')
  if n > sum_of_factors:
    print('Deficient')
  if n < sum_of_factors:
    print('Abundant')
    
if __name__=='__main__':
  main()

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

ans = 0

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)

  if total > 10**18:
    break
for i in MM:
  if int(i) == 0:
    total = 0
if total > 10**18:
  print(-1)
else:
  print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y = int(input())
flag = 0
for i in range(x+1):
  if (y - 2*i)%4 == 0 and (y -  2 * i)//4 == x - i:
    flag += 1
    print("Yes")
    break
if flag == 0:
  print("No")

Submission status: Runtime Error

Solution code:
x,y=list(map(int,input()))
if((x%2!=0) and (y%2==0)):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a,b=[int(x) for x in input().split(" ")]
x=(b-2a)/2
y=(4a-b)/2
print("Yes" if x>0 and y>0 and x%1==0.0 and y%1==0.0 else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if X % 2 == 0 and 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 4*i+(x-i)*2=y:
        print("Yes")
        exit()
print("No")

Submission status: Runtime Error

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

if n == 0:
  print(x)
else :
  pn = [int(num) for num in input().split()]
  answers = {}
  for i in range(0,101):
    if not i in pn:
      answers[i] = abs(i-x)
  print(min(answers, key=answers.get))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
#値の入力
if(2*a<=b):
    if(b<=4*a):
        print("Yes")
    else:
        pirnt("No")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,d=map(int,input().split())
ans=0
for _ in range(n):
  a,b=map(int,input().split())
  if (a*a+b*b) <= d*d:
    ans+=1
    
print(ans)

Submission status: Runtime Error

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

if ls.count(0) > 0:
    print(0)
else:
    result = 1
    for i in ls:
        result *= i
        if result > 10 ** 18:
            print(-1)
    print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 1

for i in as:
    ans *= i
    ans = min(i, 10*18+1)
    if ans == 10**18+1:
        print(-1)

else:
    print(ans)

Submission status: Runtime Error

Solution code:
xn = input().split()
data_str = input().split()
data = [int(s) for s in data_str] #data_strをint型に変換

data_2 = []

x = int(xn[0]) #これに近い値
data.sort() #小さい順

print(data)

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする
a = x-1
while True:
    #check
    for i in range(data):
        if data[i] == a:
            a = a - 1
        else:
            data_2.append(a)
            break
    if a == int(data_2[0]):
        break

#dataにない値が出るまでxかに１を足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(data):
        if int(data[i]) != b:
            data_2.append(b)
            print("bの値{}".format(b))
            break
        else:
            b = b + 1
            break
    if b == int(data_2[1]):
        break

#aとbの小さい方をprint
if abs(x-a) < abs(b-x):
    print(a)
else:
    print(b)

Submission status: Runtime Error

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

#doubutsu = 2 #X
#ashi = 100 #Y
doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if type(kame) == int and type(tsuru) == int:
    if kame >= 0 and tsuru >= 0:
        print("Yes")
    elif kame == 0 and tsuru == 0;
        print('No')
    else:
        print("No")
else:
    print("No")

Submission status: Runtime Error

Solution code:
doubutsu, ashi = input().split()

#doubutsu = 2 #X
#ashi = 100 #Y

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if type(kame) == int and type(tsuru) == int:
    if kame >= 0 and tsuru >= 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Runtime Error

Solution code:
flag = True
for a in range(101):
  if 2*a + 4*(x-a) == y:
    print("Yes")
    flag = False
    break
if flag:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y=map(int,input()).split())
tr,km,flag=0,0,0
for i in range(x):
  tr+=1
  for l in range(x-tr):
    km +=1
    if tr+km==y:
      flag=1
if frag==1:
  print("Yes")
else flag ==0:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split())  
p=(y-2x)/2
if int(p) and 1<=p<=100 :
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

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

if (Y % 2 == 0) and (4*X >= Y >=2*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')
    if i == X:
        prinnt('NO')

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
if x * 2 > y:
    flag = False
elif x * 4 < y:
    flag = False
elif (y - x * 2) % 2 == 0:
    flag = True

print('Yes' if flag == True else 'No')

Submission status: Runtime Error

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

ymax = 4 * x
ymin = 2 * x

if y >= ymin and y <= ymax and y % 2 == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

if y%2==0:
    t = [0]*(2*x+1)
    for i in range(2*x+1):
        if 2*x-i == y//2:
            t[i] = 1
        else:
            t[i] = 0
    if sum(t)==0:
        print('No')
    else:
        print('Yes')
            
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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


if i in range(x):
    if y == 4x-2a:
        print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

result = 'No'
li = []
for _ in range(X):
    li.append(2)
    if sum(li) == Y:
        result = 'Yes'
        break

for i in range(X):
    li[i] = 4
    if sum(li) == Y:
        result = 'Yes'
        break

print(result)