Technocup 2017 - Elimination Round 1 (Unofficially Open for Everyone, Rated for Div. 2)
A
Transformation: from A to B
Codeforces
1000
原题
←B →
翻译中…

Vasily has a number $*a*$, which he wants to turn into a number $*b*$. For this purpose, he can do two types of operations:

翻译中…
  • multiply the current number by $2$ (that is, replace the number $*x*$ by $2·*x*$);
  • append the digit $1$ to the right of current number (that is, replace the number $*x*$ by $10·*x* + 1$).
翻译中…

You need to help Vasily to transform the number $*a*$ into the number $*b*$ using only the operations described above, or find that it is impossible.

翻译中…

Note that in this task you are not required to minimize the number of operations. It suffices to find any way to transform $*a*$ into $*b*$.

翻译中…

Input

翻译中…

The first line contains two positive integers $*a*$ and $*b*$ ($1 ≤ *a* < *b* ≤ 10^{9}$) — the number which Vasily has and the number he wants to have.

翻译中…

Output

翻译中…

If there is no way to get $*b*$ from $*a*$, print "NO" (without quotes).

翻译中…

Otherwise print three lines. On the first line print "YES" (without quotes). The second line should contain single integer $*k*$ — the length of the transformation sequence. On the third line print the sequence of transformations $*x*_{1}, *x*_{2}, ..., *x*_{*k*}$, where:

翻译中…
  • $*x*_{1}$ should be equal to $*a*$,
  • $*x*_{*k*}$ should be equal to $*b*$,
  • $*x*_{*i*}$ should be obtained from $*x*_{*i* - 1}$ using any of two described operations ($1 < *i* ≤ *k*$).
翻译中…

If there are multiple answers, print any of them.

翻译中…

样例

Input #1
2 162
Output #1
YES
5
2 4 8 81 162
InputCopy OutputCopy
Input #2
4 42
Output #2
NO
InputCopy OutputCopy
Input #3
100 40021
Output #3
YES
5
100 200 2001 4002 40021
InputCopy OutputCopy
题目信息
标签
暴力
DFS 及类似
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。