#P10026. Reachable Number Transformation

    ID: 12003 Type: Default 1000ms 256MiB

Reachable Number Transformation

Reachable Number Transformation

We start with an integer \(a = 1\). You are allowed to perform exactly \(k\) operations. In each operation, you may choose one of the following two actions:

  • \(a \gets a - 1\)
  • \(a \gets a \times 2\)

Your task is to determine whether it is possible to obtain \(a = n\) exactly after \(k\) operations. If it is possible, print YES; otherwise, print NO.

inputFormat

The input consists of a single line containing two space-separated integers \(k\) and \(n\). Here, \(k\) represents the exact number of operations, and \(n\) is the target integer value.

outputFormat

Output a single line containing YES if it is possible to reach \(n\) from \(1\) after exactly \(k\) operations; otherwise, output NO.

sample

1 2
YES