N, K = map(int, input().split())

# Special case: N=1 can be achieved with 0 operations (if K >=0)
if N == 1:
    print("YES")
else:
    possible = False
    for m in range(0, 60):  # 2^60 is way larger than 2e5
        x = 1 << m
        if x > N:
            break
        rem = N - x
        if rem < 0:
            continue
        if rem % 3 != 0:
            continue
        Q = rem // 3
        set_bits = bin(Q).count('1')
        max_a = min(Q, K - m)
        if max_a < 0:
            continue
        min_a = set_bits
        if min_a <= max_a:
            possible = True
            break
    print("YES" if possible else "NO")