def popcount(n): cnt = 0 while n: cnt += n & 1 n //= 2 return cnt N, K = map(int, input().split()) two = 1 for i in range(20): M = N - two cnt = i if M % 3 != 0 or M < 0: two *= 2 continue q, r = divmod(M//3, two) cnt += q + popcount(r) # print(i, M, q, r, cnt) if cnt <= K: print("YES") exit() two *= 2 print("NO")