Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    bit = 2**x
    if 4*x<y:
        print('No')
        exit()
    for i in range(bit):
        tmp = 0
        for j in range(x):
            if (i>>j)&1:
                tmp += 2
            else:
                tmp += 4
            if y<tmp:
                continue
        if tmp == y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Fixed submission:
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    if 4*x<y or y%2!=0:
        print('No')
        exit()
    for i in range(x+1):
        if 4*i+2*(x-i)==y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    bit = 2**x
    for i in range(bit):
        tmp = 0
        for j in range(x):
            if (i>>j)&1:
                tmp += 2
            else:
                tmp += 4
            if y<tmp:
                continue
        if tmp == y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Fixed submission:
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    if 4*x<y or y%2!=0:
        print('No')
        exit()
    for i in range(x+1):
        if 4*i+2*(x-i)==y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    bit = 2**x
    for i in range(bit):
        tmp = 0
        for j in range(x):
            if (i>>j)&1:
                tmp += 2
            else:
                tmp += 4
            if y<tmp:
                continue
        if tmp == y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Fixed submission:
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    if 4*x<y or y%2!=0:
        print('No')
        exit()
    for i in range(x+1):
        if 4*i+2*(x-i)==y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    bit = 2**x
    for i in range(bit):
        tmp = 0
        for j in range(x):
            if (i>>j)&1:
                tmp += 2
            else:
                tmp += 4
        if tmp == y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()

Fixed submission:
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x,y = IL()
    if 4*x<y or y%2!=0:
        print('No')
        exit()
    for i in range(x+1):
        if 4*i+2*(x-i)==y:
            print('Yes')
            exit()
    print('No')
    return

if __name__=='__main__':
    main()