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.

The first line contains two positive integers a and b (1 ≤ a < b ≤ 109) — the number which Vasily has and the number he wants to have.

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 x1, x2, ..., xk, where:   x1 should be equal to a,  xk should be equal to b,  xi should be obtained from xi - 1 using any of two described operations (1 < i ≤ k).  If there are multiple answers, print any of them.

a, b = [int(i) for i in input().split()]
s = str(b)
while b > a:
    if str(b)[-1] == '1':
        b = b // 10
        s += ' ' + str(b)
    elif b % 2 == 0:
        s += ' ' + str(b // 2)
        b = b // 2

    else:
        break
if b == a:
    print('YES')
    print(s.count(' ') + 1)
    print(' '.join(s.split()[::-1]))
else:
    print('NO')

import time

def read(t=None):
	string = raw_input()
	return string if t is None else [t(x) for x in string.split()]

def solve():
	x, y = read(int)
	a  = [y]
	while y != x:
		#print a
		#time.sleep(1)
		if y % 2 == 0:
			y /= 2
			a.append(y)
		else:
			y -= 1
			if y != 0 and y % 10 == 0:
				y /= 10
				a.append(y)
			else:
				print "NO"
				return
	print 'YES'
	n = len(a)
	print n
	for i in range(n-1, -1, -1):
		print a[i],
	print

if __name__ == "__main__":
	solve()

"""
Author    : co_devil Chirag Garg
Institute : JIIT
"""

from __future__ import division, print_function
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
# from heapq import nsmallest, nlargest, heapify, #heappop ,heappush, heapreplace
from math import ceil,floor,log,sqrt,factorial,pow,pi
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
"""from io import BytesIO, IOBase
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__
    str = lambda x=b'': x if type(x) is bytes else __str__(x).encode()
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._buffer = BytesIO()
        self._fd = file.fileno()
        self._writable = 'x' in file.mode or 'r' not in file.mode
        self.write = self._buffer.write if self._writable else None

    def read(self):
        return self._buffer.read() if self._buffer.tell() else os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b, ptr = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE)), self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
            self.newlines += b.count(b'\n') + (not b)
        self.newlines -= 1
        return self._buffer.readline()

    def flush(self):
        if self._writable:
            os.write(self._fd, self._buffer.getvalue())
            self._buffer.truncate(0), self._buffer.seek(0)
sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b'\r\n')

def print(*args, **kwargs):
    sep, file = kwargs.pop('sep', b' '), kwargs.pop('file', sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop('end', b'\n'))
    if kwargs.pop('flush', False):
        file.flush()

"""

def ii(): return int(input())
def si(): return str(input())
def mi(): return map(int,input().split())
def li(): return list(mi())

abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}
mod = 1000000007
dx, dy = [-1, 1, 0, 0], [0, 0, 1, -1]
def getKey(item): return item[0]
def sort2(l): return sorted(l, key=getKey)
def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo(x): return (x and (not (x & (x - 1))))
def decimalToBinary(n): return bin(n).replace("0b", "")
def ntl(n): return [int(i) for i in str(n)]
def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
# For getting input from input.txt file
# sys.stdin = open('input.txt', 'r')

# Printing the Output to output.txt file
# sys.stdout = open('output.txt', 'w')

graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000
def dfs(v, c):
    if visited[v]:
        if col[v] != c:
            print('-1')
            exit()
        return
    col[v] = c
    visited[v] = 1
    for i in graph[v]:
        dfs(i, c ^ 1)

def bfs(d,v):
    q=[]
    q.append(v)
    visited[v]=1
    while len(q)!=0:
        x=q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i]!=1:
                visited[i]=1
                q.append(i)
        print(x)
def make_graph():
    d={}
    v,e=mi()
    for i in range(e):
        x,y=mi()
        if x not in d.keys():
            d[x]=[y]
        else:
            d[x].append(y)
        if y not in d.keys():
            d[y] = [x]
        else:
            d[y].append(x)
    return d
def gr2(n):
    d={}
    for i in range(n):
        x,y=mi()
        if x not in d.keys():
            d[x]=[y]
        else:
            d[x].append(y)
    return d

x,y=mi()
y=str(y)
z=y
ans='NO'
out=[]
while x<=int(y):
    if y[-1]=='1':
        y=y[:-1]
    elif int(y)%2==0:
        y=str(int(y)//2)
    else:
        break
    if x==int(y):
        ans='YES'
        break
    out.append(y)
print(ans)
if ans=='YES':
    out.append(str(x))
    out=out[::-1]
    out.append(z)
    print(len(out))
    print(' '.join(out))

a, b = map(int,raw_input().split())

def toget(x,y):
	if x==y:
		return [x]
	if x>y :
		return [-1]
	else:
		casea = [x] + toget(x*2, y)
		caseb = [x] + toget((x*10) +1, y)
	if casea[-1] != -1:
		return casea
	elif caseb[-1] != -1:
		return caseb
	else:
		return [-1]
result = toget(a,b)

if result != [-1]:
	print "YES"
	print len(result)
	print ' '.join(str(x) for x in result)
else:
	print "NO"

a,b = map(int,input().split())
l = [b]
while b % 2 == 0 or b % 10 == 1:
    if b == 0 or b == 1:
        break
    if b == a:
        break
    elif b % 2 == 0:
        b = int(b/2)
        l.append(b)
    else:
        b = int((b-1)/10)
        l.append(b)

if b == a:
    print("YES")
    print(len(l))
    print(*reversed(l))
else:
    print("NO")

from sys import stdin, stdout
a, b = map(int,stdin.readline().split())
q = [ [a,[a]] ]
ans = []
while len(q):
    f = q.pop(0)
    cur,l = f[0],f[1]
    if cur == b:
        ans = l
        break
    n1,n2 = 2*cur, int(str(cur)+'1')
    if n1<=b:
        q.append([ n1,l+[n1] ])
    if n2<=b:
        q.append( [n2,l+[n2]] )
if len(ans):
    stdout.write("YES\n")
    stdout.write("{}\n".format(len(ans)))
    for x in ans:
        stdout.write("{} ".format(x))
    stdout.write("\n")
else:
    stdout.write("NO\n")

a, b = map(int, input().split())
ans = [b]
while True:
    if b % 10 == 1:
        b //= 10
    elif b % 2 == 0:
        b //= 2
    else:
        break
    if a >= b:
        break
    ans.append(b)
ans.append(a)
if a != b:
    print("NO")
else:
    print("YES")
    print(len(ans))
    print(*ans[::-1])

def solve(n:int):
    global answer, a
    answer.append(n)
    if n<=a:
        return 0
    if n%10==1:
        return solve(n//10)
    elif n%2==0:
        return solve(n//2)
    else:
        print("NO")
        exit()

a, b = map(int, input().split())
answer = list()
solve(b)
if answer[-1] != a:
    print("NO")
else:
    print("YES")
    print(answer.__len__())
    for i in range(answer.__len__()-1, -1, -1):
        print(answer[i], end=" ")

a, b = map(int, raw_input().split())

seq = [b]
while b > a:
    if b % 10 == 1:
        b /= 10
    elif b % 2 == 0:
        b /= 2
    else:
        break
    seq.append(b)

if a == b:
    print "YES"
    print len(seq)
    print " ".join(map(str, reversed(seq)))
else:
    print "NO"

a,b = map(int,raw_input().split())
s = [str(b)]
while 1:
    if b%10==1:
        b = b/10
        s.append(str(b))
    else:
        if b%2==0:
            b = b/2
            s.append(str(b))
        else:
            print 'NO'
            exit(0)
    if b==a:
        print 'YES'
        print len(s)
        print ' '.join(s[::-1])
        exit(0)
    if b<a:
        print 'NO'
        exit(0)

a,b = map(int,input().split())
output = []
num = b
n1,n2=0,0

output.append(num)

while (num!=a):
    if (num<a):
        output.clear()
        print("NO")
        exit()
    elif (num%2==0):
        num/=2
        output.append(int(num))
    elif (int(num/10)%2==0):
        num=int(num-1)/10
        output.append(int(num))
    else:
        num=int(num-1)/10
        output.append(int(num))

output.reverse()
print("YES")
print(len(output))
for i in output:
    print(i, end=" ")

#coding:utf-8
a, b = map(str, raw_input().split())
intb = int(b)
inta = int(a)
list =[b]

def AtoB(inta, intb, b):
    if(intb == inta):
        return "YES"
    if(intb % 2 != 0 and b[len(b)-1] != "1" or intb < inta):
        return "NO"
    if(b[-1] != "1"):
        intb = intb/2
        b = str(intb)
        list.append(intb)
        return AtoB(inta, intb, b)
    else:
        intb = (intb-1)/10
        b = str(intb)
        list.append(intb)
        return AtoB(inta, intb, b)

if(AtoB(inta,intb, b) == "YES"):
    print "YES"
    print len(list)
    for i in xrange(len(list)-1, -1, -1):
        print list[i],
else:
    print"NO"

n,k=list(map(int,input().split()))
answer=[]
answer.append(k)
while k>n:
    if k%2==0:
        k=k//2
        answer.append(k)
    if k%10==1 and k!=1:
        k=(k-1)//10
        answer.append(k)
    if k==n:
        print('YES')
        print(len(answer))
        l=len(answer)
        for i in range(l):
            print(answer[l-i-1],' ',end='')
        break
    elif (k%2!=0 and k%10!=1) or k<n:
        print('NO')
        break

'''input
4 42
'''

import math
import sys
import itertools
import random

def lcm(x, y):
	return (x*y)//math.gcd(x,y)
def hcf(x, y):
	return math.gcd(x, y)

def backtrack(a, b, n, path):
	global g
	if n > b:
		return
	if n == b:
		g=path
	backtrack(a, b, n*2, path+[n*2])
	backtrack(a, b, int(str(n)+'1'), path+[int(str(n)+'1')])

# for _ in range(0, int(input())):
	# n=int(input())                                 # Single Digit Input
x, y = map(int, input().strip().split())    # Many Digit Input
	# l=list(map(int, input().strip().split()))      # List Input
	# s=list(input())                                # Character Array Input

g=[]
backtrack(x, y, x, [x])
if g == []:
	print("NO")
else:
	print('YES')

	print(len(g))
	print(*g)

from collections import deque

a, b = map(int, input().split())
num = b
ans = deque()
cnt = 0
while num > a:
    if not num % 2:
        ans.appendleft(num)
        cnt += 1
        num //= 2
    else:
        if str(num)[-1] == '1':
            ans.appendleft(num)
            cnt += 1
            num = int(str(num)[:-1])
        else:
            print("NO")
            exit()
if num == a:
    ans.appendleft(num)
    cnt += 1
if num not in ans:
    print("NO")
    exit()
print("YES")
print(cnt)
print(*ans)

def main():
    def f(a, b):
        if a == b:
            return (True, [])
        if a > b:
            return (False, [])
        (f1, x1) = f(2 * a, b)
        if f1:
            return (True, [(2 * a)] + x1)
        (f2, x2) = f(int(str(a) + '1'), b)
        if f2:
            return (True, [int(str(a) + '1')] + x2)
        return (False, [])
    (a, b) = map(int, input().split(' '))
    (f, x) = f(a, b)
    if f:
        x = [a] + x
        print("YES")
        print(len(x))
        print(' '.join(list(map(str, x))))
    else:
        print("NO")
main()

a, b = map(int, input().split())
way = []
while b > a:
    way.append(b)
    if b % 2 == 0:
        b //= 2
    else:
        if b % 10 == 1:
            b -= 1
            b //= 10
        else:
            print("NO")
            exit(0)
way.append(a)
if a != b:
    print("NO")
else:
    print("YES")
    print(len(way))
    print(*reversed(way))

def multiple(a, b, seq):
    if a == b:
        return seq + [a]
    if a > b:
        return []
    if a < b:
        return multiple(a*2,b,seq + [a]) or multiple((a*10)+1,b,seq + [a])

a,b = map(int,input().split(' '))
res = multiple(a,b,[])
if len(res) == 0:
    print('NO')
else:
    print('YES', len(res), sep='\n')
    print(*res)

line = input().split()
a = int(line[0])
b = int(line[1])
travel = [] #inisialisasi travel untuk menunjukkan asalnya dari mana
travel.append([])
q = [a] #inisialisasi queue utk BFS
index = 0
#proses BFS
##while len(q) > 0:
####    print(q[0])
####    print(travel)
####    if q[0] == b: #jika queue terdepan sudah sama
####        print("YES", len(travel[len(travel) - 2]) + 1, sep='\n')
####        for i in travel[len(travel) - 2]:
####            print(i, end=' ')
####        print(q[0])
####        break
####    else:
##        temp = q[0] * 2 #proses untuk anak kiri
####        print(len(travel), "index =", index, "travel[index] =", travel[index], "q =", q[0])
####        print(temp, q[0])
##        if temp <= b and index < len(travel): #dibatasi tidak melebihi b dan index belum melebihi panjang array travel
##            q += [temp] #push data baru
##            travel.append([]) #array travel ditambah panjangnya
####            print(len(travel), "index =", index)
##            travel[len(travel) - 1] = list(travel[index]) #mengcopy array dari travel asal
##            travel[len(travel) - 1] += [q[0]] #travel baru ditambah dengan q[0] untuk menandakan dia berasal dari node tersebut
##            if temp == b: #jika temp sudah sama
##                print("YES", len(travel[len(travel) - 1]) + 1, sep='\n')
##                for i in travel[len(travel) - 1]:
##                    print(i, end=' ')
##                print(temp)
##                break
####            print(temp, "travel kali =", travel[temp], "travel asal =", travel[q[0]], end='-----')
####        elif temp ==
##        temp = (q[0] * 10) + 1 #Proses untuk anak kanan
##        if temp <= b and index < len(travel):
##            q += [temp] #push data baru
##            travel.append([]) #array travel ditambah panjangnya
##            travel[len(travel) - 1] = list(travel[index]) #mengcopy array dari travel asal
##            travel[len(travel) - 1] += [q[0]]
##            if temp == b: #jika temp sudah sama
##                print("YES", len(travel[len(travel) - 1]) + 1, sep='\n')
##                for i in travel[len(travel) - 1]:
##                    print(i, end=' ')
##                print(temp)
##                break
####            print(temp, "travel tambah =", travel[temp], "travel asal =", travel[q[0]])
##        q.pop(0) #pop dari queue
##        index += 1 #index ditambah menunjukkan asal nodenya
##        if len(q) == 0: #jika queue kosong menandakan angka tersebut tidak dapat ditemukan
##            print("NO")
#proses DFS
#penelusuran terbalik dari bawah ke atas
q =[b]
while b > a:
    if b % 2 == 0: #jika genap maka pasti merupakan hasil kali 2
        b = int(b/2) #karena itu dibagi 2
        q += [b]
    elif b % 10 == 1: #jika berakhiran 1, merupakan hasil penambahan digit 1 di belakang
        b = int(b/10) #karena itu dibagi 10
        q += [b]
    else: #jika tidak memenuhi keduanya maka sudah pasti angka tersebut mustahil dicapai
        break

q.reverse() #dibalik untuk pencetakan
if a == b:
    print("YES", len(q), sep='\n')
    for i in q:
        print(i, end=' ')
else:
    print("NO")

import sys
import copy

def op1(n):
	return n*2
def op2(n):
	return (n*10)+1
def revop1(n):						# 0
	return n/2
def revop2(n):						# 1
	return (n-1)/10

a,B=map(float,filter(lambda a:a!='',raw_input().split(' ')))
# print a,b
operations=[]
b=copy.copy(B)
while b>a:
	if b%2==0:
		b=revop1(b)
		operations.append(0)
	else:
		b=revop2(b)
		operations.append(1)
if b==a:
	print 'YES'
	print len(operations)+1
	sys.stdout.write('%d '%a)
	for i in range(len(operations)-1,-1,-1):
		if operations[i]==0:
			a=op1(a)
		elif operations[i]==1:
			a=op2(a)
		sys.stdout.write('%d '%a)
	sys.exit(0)
else:
	print 'NO'
	sys.exit(0)

a, b = map(int, input().split())
X = [b]

while a < b:
    if b % 2:
        b, m = divmod(b, 10)
        if m != 1:
            break
    else:
        b //= 2
    X.append(b)

if a != b:
    print('NO')
else:
    print('YES')
    print(len(X))
    print(*reversed(X))

a, b = map(int, input().split())

seq = []

def d(s):
    if s > b:
        return False
    if s == b:
        seq.append(s)
        return True

    for i in range(2):
        if i==0:
            hit = d(2*s)
            if hit:
                seq.append(s)
                return True

        if i == 1:
            hit = d(10*s +1)
            if hit:
                seq.append(s)
                return True
d(a)
if len(seq) > 0:
    print("YES")
    # seq += [a]
    # seq.append(a)
    print(len(seq))

    for i in reversed(seq):
        print(i, end = " ")
else:
    print("NO")

a, b = map(int, input().split())
mass = [b]
while a != b:
	if str(b)[-1] != '1' and b % 2 != 0 and a > b or b == 0:
		print('NO')
		exit()
	else:
		if str(b)[-1] == '1' and len(str(b)) != 1:
			b = int(str(b)[:-1])
		elif b % 2 == 0:
			b = b // 2
		else:
			print('NO')
			exit()
		mass.append(b)
print('YES')
print(len(mass))
print(*mass[::-1])

a,b=map(int,input().split())
ans=[b]
while(b>a):
    if b%2==0:
        b//=2
        ans.append(b)
    elif b%10==1:
        b//=10
        ans.append(b)
    else:
        break
if b==a:
    print("YES")
    print(len(ans))
    ans.sort()
    print(*ans)
else:
    print("NO")

##############--->>>>> Deepcoder Amit Kumar Bhuyan <<<<<---##############

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
import sys
input = sys.stdin.readline
scan_int = lambda: int(input())
scan_string = lambda: input().rstrip()
read_list = lambda: list(read())
read = lambda: map(int, input().split())
read_float = lambda: map(float, input().split())
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

def ceil(x):
    if x != int(x):
        x = int(x) + 1
    return x

def factorial(x, m):
	val = 1
	while x>0:
		val = (val * x) % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

## gcd function
def gcd(a,b):
    if b == 0:
        return a;
    return gcd(b, a % b);

## lcm function
def lcm(a, b):
	return (a * b) // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

## nCr function efficient using Binomial Cofficient
def nCr(n, k):
	if k > n:
		return 0
	if(k > n - k):
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

## upper bound function code -- such that e in a[:i] e < x;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p):
    res = 1
    x = x % p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) :
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];

    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;

# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n):
    prime = [True for i in range(n+1)]
    prime[0], prime[1] = False, False
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime

# Euler's Toitent Function phi
def phi(n) :

    result = n
    p = 2
    while(p * p<= n) :
        if (n % p == 0) :
            while (n % p == 0) :
                n = n // p
            result = result * (1.0 - (1.0 / (float) (p)))
        p = p + 1
    if (n > 1) :
        result = result * (1.0 - (1.0 / (float)(n)))

    return (int)(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False

	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
def factoriazation(x):
    res = []
    for i in range(2, int(x ** 0.5) + 1):
    	while x % i == 0:
    		res.append(i)
    		x //= i
    if x != 1:
   		res.append(x)
    return res
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

def float_array():
    return list(map(float, input().strip().split()));

## taking string array input
def str_array():
    return input().strip().split();

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		# print(low, mid, high)
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

## for checking any conditions
def check(beauty, s, n, count):
	pass

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
alphs = "abcdefghijklmnopqrstuvwxyz".upper()

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	a, b = read()
	ans = []
	while b > a:
		ans.append(b)
		if b % 2 == 0:
			b //= 2
		elif b % 10 == 1:
			b //= 10
		else:
			break
	ans.append(b)
	if a == b:
		print("YES")
		print(len(ans))
		print(*ans[::-1])
	else:
		print("NO")

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    for i in range(1):
    	solve()
    #dmain()

# Comment Read()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))

lst = input().split()

a = int(lst[0])
b = int(lst[1])

result_lst = []
result_lst.append(b)
while b > a:
    if b % 10 == 1:
        b -= 1
        b //= 10
    elif b % 2 == 0:
        b //= 2
    else:
        break
    result_lst.append(b)

if b == a:
    print('YES')
    print(len(result_lst))
    result_lst.reverse()
    result_lst = [str(i) for i in result_lst]
    print(' '.join(result_lst))
else:
    print('NO')

a,b = map(int,input().split())
lst = []
while b > a:
    lst.append(b)
    if str(b)[-1] == '1':
        b = int(str(b)[:-1])
    else:
        if b%2 == 0:
            b //= 2
        else:
            print('NO')
            exit()

lst.append(a)
if b == a:
    print('YES')
    print(len(lst))
    print(*lst[::-1])
else:
    print('NO')

a,b=map(int,input().split())
ans= [b]
while True:
    if b%10==1:
        b=b//10
    elif b%2==0:
        b=b//2
    else:
        break
    if a>=b:
        break
    ans.append(b)
ans.append(a)
if a!=b:
    print("NO")
else:
    print("YES")
    print(len(ans))
    print(*ans[::-1])

a,b = map(int,input().split())
d = b
c = b%10
if c % 2!=0 and c!=1:
	print("NO")
else:
	l = []
	if c == 1:
		b = b-1
		b//=10
		l.append(b)
	else:
		b//=2
		l.append(b)
	while b > a:
		if b % 2 != 0 and b%10!=1:
			print("NO")
			exit()
		if b % 10 == 1:
			b-=1
			b//=10
		else:
			b//=2
		l.append(b)
	if b != a:print("NO")
	else:
		print("YES")
		print(len(l)+1)
		s=""
		for i in range(len(l)-1,-1,-1):s+=str(l[i]);s+=" "
		s+=str(d)
		print(s)

a , b = map(int,input().split())

cnt = 1
ans = [b]
flag = True
while b > a :
    r = b % 10
    if r % 2 == 0 :
         b //= 2
         cnt +=1
         ans.append(b)

    else:
        if b % 10 % 2 != 0 and b % 10 != 1 :
            flag = False
            break
        else:
            b //= 10
            ans.append(b)
            cnt +=1

#print(b)
if flag and a == b:
    print('YES')
    print(cnt)
    ans = list(reversed(ans))
    print(*ans)

else:
    print('NO')

def com1(x):
    return 2*x

def com2(x):
    return 10 * x + 1

def decom2(x):
    return (x - 1) // 10

def decom1(x):
    return x // 2

a,b = map(int, input().split())
test = b
list1 = [b]

while (test >= 1) and (test != a):
    if test % 10 == 1:
        test = decom2(test)
    elif test % 2 == 0:
        test = decom1(test)
    else:
        break
    list1.append(test)

if test == a:
    print('YES')
    print(len(list1))
    for i in range(-1,-len(list1)-1,-1):
        print(list1[i], end = ' ')
else:
    print('NO')

from collections import deque
a, b = map(int, raw_input().split(" "))
pre = {}
fila = deque([a])
while fila:
	v = fila.popleft()
	if 2*v not in pre and 2*v <= b:
		fila.append(2*v)
		pre[2*v] = v
	if 10*v+1 not in pre and 10*v+1 <= b:
		fila.append(10*v+1)
		pre[10*v+1] = v

seq = [b]
if b not in pre:
	print "NO"
else:
	print "YES"
	x = b
	while x != a:
		x = pre[x]
		seq.append(x)
	print len(seq)
	for i in seq[::-1]:
		print(i),

a, b = map(int, input().split())
cnt = 1
op = [b]
while b > a:
	if b % 10 == 1:
		b //= 10
		cnt += 1
		op.append(b)
	elif b % 10 % 2 == 0:
		b //= 2
		cnt += 1
		op.append(b)
	else:
		print('NO')
		exit()
if b < a:
	print('NO')
else:
	print('YES')
	print(cnt)
	print(' '.join(map(str, op[::-1])))

import sys

a, b = sys.stdin.readline().strip().split()
a, b = int(a), int(b)

mas = []

while b>=a:
    mas += [b]
    if b % 2 == 0:
        b=b/2
    elif b%10==1:
        b=(b-1)/10
    elif a != b:
        print "NO"
        exit(0)
    else:
        break;
mas.reverse()

if a==mas[0]:
    print "YES"
    print len(mas)
    print " ".join(map(str, mas))
else:
    print "NO"

def multiple(a, b, seq):
    if a == b:
        return seq + [a]
    if a > b:
        return []
    if a < b:
        return multiple(a*2,b,seq + [a]) or multiple((a*10)+1,b,seq + [a])

a,b = map(int,input().split(' '))
res = multiple(a,b,[])
if len(res) == 0:
    print('NO')
else:
    print('YES', len(res), sep='\n')
    print(*res)

a,b=input().split()
s=[]
s.append(b)
while 1:
    if int(b[-1])!=1 and int(b)%2!=0:
        print('NO')
        break
    u=0
    while True:
        if  len(b)!=0 and b[-1]=='1' and int(a)<int(b):
            b=list(b)
            del b[-1]
            b=''.join(b)
            s.append(b)
        elif  len(b)!=0 and int(b)%2==0 and a!=b and len(b)!=0 and int(a)<int(b):
             b=str(int(int(b)/2))
             s.append(b)
        elif b==a:
            s.append(a)
            break
        elif len(b)!=0:
            u+=1

            break
        elif len(b)==0:
            break

        elif a==b:
            break
        elif len(b)!=0 and a!=b:
            u+=1

            break
        elif a==b:
            break
    del s[-1]
    s.reverse()
    if u:
        print('NO')
        break
    else:
        print('YES')
        print(len(s))
        print(*s)
        break

a, b = map(int, raw_input().split())
n = b
s = []
while True:
    s.append(n)
    if n <= a: break
    if n % 2 == 0:
        n /= 2
    elif n % 10 == 1:
        n /= 10
    else:
        n = 0
if a == n:
    print 'YES'
    print len(s)
    print ' '.join(map(str, reversed(s)))
else:
    print 'NO'

a,b=input().split()
a=int(a)
b=int(b)
f=0
l=[]
while(b>a):
    if (b%2==1):
        if (b-1)%10==0:
            l.append(b)
            b=(b-1)//10
        else:
            print("NO")
            f=1
            break
    else:
        l.append(b)
        b=b//2
if (f==0):
    if a==b:
        print("YES")
        l.append(a)
        print(len(l))
        for i in range (len(l)):
              print(l[len(l)-i-1],end=' ')
    else:
        print("NO")

# LINK FOR PROBLEM: http://codeforces.com/problemset/problem/727/A

def ends_with_one(number):
    number = str(number)
    return number[-1] == "1"

def del_last_one(number):
    number = str(number)
    t = len(number)
    number = int( number[:t-1] )
    return number

def isEven(number):
    return (number % 2 == 0)

a, b = map(int, raw_input().split())
fila = [str(b)]

current_number = b

while current_number > a:

    if ends_with_one(current_number):
        current_number = del_last_one(current_number)
        fila.append(str(current_number))

    elif isEven(current_number):
        current_number = current_number / 2
        fila.append(str(current_number))

    else:
        current_number = a-1
        break

if current_number < a:
    print "NO"

elif current_number == a:

    print "YES"
    print len(fila)
    print " ".join(str(fila[i]) for i in range(len(fila)-1, -1, -1 ))

path = []

def seek(a, b):
    if a > b:
        return False
    if a == b:
        return True
    for x in [ 2*a, 10*a + 1 ]:
        path.append(x)
        if seek(x, b):
            return True
        path.pop()
    return False

a, b = map(int, raw_input().split())
path.append(a)
if seek(a, b):
    print('YES')
    print(len(path))
    print(' '.join(map(str, path)))
else:
    print('NO')

a,b=map(int,input().split())
l=[b]
while(a<b):
    if b%2:
        if b%10==1:
            b//=10
            l.append(b)
        else:
            break
    else:
        b//=2
        l.append(b)
if a==b:print("YES");print(len(l));print(*l[::-1])
else:print("NO")

a,b=raw_input().split()
a,b=int(a),int(b)
out=[b,]
while a<b:
	if b%2==0:
		b/=2
		out.append(b)
	elif (b-1)%10==0:
		b=(b-1)/10
		out.append(b)
	else:
		break
if a==b:
	print "YES"
	print len(out)
	for i in reversed(out):
		print i,
else:
	print "NO"

flag=True
def fun(a,b,ind,temp):
    global flag
    if a==b:
        flag=False
        print("YES")
        print(ind)
        for i in range(0,ind-1):
            print(temp[i],end=' ')
        print(temp[ind-1])
        return
    if a>b:
        return
    temp[ind]=2*a
    fun(2*a,b,ind+1,temp)
    temp[ind]=10*a+1
    fun(10*a+1,b,ind+1,temp)

arr=list(map(int,input().split()))
temp=[0]*(32)
temp[0]=arr[0]

fun(arr[0],arr[1],1,temp)
if flag:
    print("NO")

# http://codeforces.com/problemset/problem/727/A

def dfs(q, n, steps):
    if n == q:
        return True
    elif n > q:
        return False

    a = dfs(q, n * 2, steps)
    b = dfs(q, (n * 10) + 1, steps)

    if a:
        steps.append(n * 2)
    if b:
        steps.append((n * 10) + 1)

    return a or b

a, b = map(int, raw_input().split())
steps = []

if not dfs(b, a, steps):
    print 'NO'

else:
    print 'YES'
    steps.append(a)
    steps.reverse()
    print len(steps)
    print ' '.join(map(str, steps))

import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy

ORDA = 97  # a
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return [int(i) for i in input().split()]
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def revn(n): return str(n)[::-1]
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r
def divs(n, start=2):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
def prime(n):
    if n == 2: return True
    if n % 2 == 0 or n <= 1: return False
    sqr = int(math.sqrt(n)) + 1
    for d in range(3, sqr, 2):
        if n % d == 0: return False
    return True
def convn(number, base):
    new_number = 0
    while number > 0:
        new_number += number % base
        number //= base
    return new_number
def cdiv(n, k): return n // k + (n % k != 0)
def ispal(s):
    for i in range(len(s) // 2 + 1):
        if s[i] != s[-i - 1]:
            return False
    return True

a, b = mi()
ans = [b]
while a < b:
    if b % 2 != 0 and b % 10 != 1:
        print('NO')
        exit()
    if b % 2 == 0:
        b //= 2
        ans.append(b)
    if b != 1 and b % 10 == 1:
        b //= 10
        ans.append(b)
if a == b:
    print('YES')
    print(len(ans))
    print(*ans[::-1])
else:
    print('NO')

line = input().split()
a = int(line[0])
b = int(line[1])
##travel = [[] for i in range(b+1)] #inisialisasi travel untuk menunjukkan asalnya dari mana
##q = [a] #inisialisasi queue utk BFS
###proses BFS
##while len(q) > 0:
##    print(q[0])
##    if q[0] == b: #jika queue terdepan sudah sama
##        print("YES", len(travel[q[0]]) + 1, sep='\n')
##        for i in travel[q[0]]:
##            print(i, end=' ')
##        print(q[0])
##        break
##    else:
##        if b % 2 == 0:
##            temp = q[0] * 2 #proses untuk anak kiri
##            if temp <= b and len(travel[temp]) == 0: #dibatasi tidak melebihi b
##                q += [temp] #push data baru
##                travel[temp] = list(travel[q[0]]) #mengcopy array dari travel asal
##                travel[temp] += [q[0]] #travel baru ditambah dengan q[0] untuk menandakan dia berasal dari node tersebut
####            print(temp, "travel kali =", travel[temp], "travel asal =", travel[q[0]], end='-----')
##        temp = (q[0] * 10) + 1 #Proses untuk anak kanan
##        if temp <= b and len(travel[temp]) == 0:
##            q += [temp] #push data baru
##            travel[temp] = list(travel[q[0]]) #mengcopy array dari travel asal
##            travel[temp] += [q[0]] #travel baru ditambah dengan q[0] untuk menandakan dia berasal dari node tersebut
####            print(temp, "travel tambah =", travel[temp], "travel asal =", travel[q[0]])
##        q.pop(0) #pop dari queue
##        if len(q) == 0: #jika queue kosong menandakan angka tersebut tidak dapat ditemukan
##            print("NO")

q =[b]
while b > a:
    if b % 2 == 0:
        b = int(b/2)
        q += [b]
    elif b % 10 == 1:
        b = int(b/10)
        q += [b]
    else:
        break

q.reverse()
if a == b:
    print("YES", len(q), sep='\n')
    for i in q:
        print(i, end=' ')
else:
    print("NO")

a, b = input().split()
a = int(a)
b = int(b)
c = b
d = ''
t = ''

n = [a]
while a != c:
    if (c % 2 == 0) and (a <= c):
        c = c / 2
        d = d + '1'
    elif (c - 1) % 10 == 0 and (a <= c):
        c = (c - 1) / 10
        d = d + '2'
    else:
        break
if a == c:
    print('YES')
    t = d[::-1]
    f = len(t)
    print(len(t) + 1)
    for i in range (1, f + 1):
        if t[i-1:i] == '1':
            a = a * 2
            n.append(a)
        else:
            a = (a * 10) + 1
            n.append(a)
    for i in range(0, f + 1):
        print(n[i], end = ' ')
elif c != a:
    print('NO')

X = list(map(int, input().split()))
Answer = [X[0]]
def DFS(Num, Type):
    if Num > X[1]:
        return
    if Num == X[1]:
        print("YES")
        print(len(Answer))
        print(*Answer)
        exit()
    Num = (Num * 2 if Type == 0 else Num * 10 + 1)
    Answer.append(Num)
    DFS(Num, 0)
    Answer.pop()
    Answer.append(Num)
    DFS(Num, 1)
    Answer.pop()
DFS(X[0], 0)
DFS(X[0], 1)
print("NO")

def dfs(a,b,ans):
	if a>b:
		return 0
	if a==b:
		ans.append(a)
		return 1
	if dfs(2*a,b,ans):
		ans.append(a)
		return 1
	if dfs(10*a+1,b,ans):
		ans.append(a)
		return 1
	return 0;

a,b=map(int,raw_input().split())
ans=[]
if dfs(a,b,ans):
	print "YES"
	print len(ans)
	for i in range(len(ans)):
		print ans[len(ans)-i-1],
else:
	print "NO"

n,k=map(int,input().split())
l1=[]
l1.append(k)
while(True):
    if(k%2!=0 and k%10!=1):
        break
    elif(k%2==0):
        k=int(k/2)
        l1.append(k)
    elif(k%10==1):
        k=int(k/10)
        l1.append(k)
    if(k==n or k<n):
        break
if(k==n):
    print("YES")
    print(len(l1))
    l1.sort()
    for i in range (len(l1)):
        print(l1[i],end=" ")
else:
    print("NO")

a, b = map(int, input().split())
steps = list()
steps.append(b)
Done = False
while b != a:
    if (b - 1)%10 == 0:
        b = (b-1)//10
        steps.append(b)
    if b % 2 == 0 and b != a:
        b = b//2
        steps.append(b)
    if (b - 1)%10 != 0 and b % 2 != 0 and b != a or b < a:
        print('NO')
        Done = True
        break
if Done is False:
    print('YES')
    print(len(steps))
    steps.reverse()
    print(' '.join(map(str, steps)))

#http://codeforces.com/problemset/problem/727/A

a, b = map(int, raw_input().split())

def found_num(a, b):
    sequence = []
    founded = False
    size = 0
    while (b >= a):
        sequence.append(int(b))
        size += 1
        if (b == a):
            founded = True
            break
        if (b % 2 == 0):
            b = b/2.0
        else:
            b = (b - 1)/10.0
    return founded, size, sequence

def print_result(result, size):
    sequence = str(result[size - 1])
    for i in xrange(size - 2, -1, -1):
        sequence += " " + str(result[i])
    return sequence

result = found_num(a, b)
founded = result[0]
size = result[1]
result_formated = print_result(result[2], size)

if (founded):
    print "YES"
    print size
    print result_formated
else:
    print "NO"

n, x = list(map(int, input().rstrip().split(" ")))
l = [x]
while x>n:
    if x == n:
        break
    if x%10==1:
        x = x//10
        l.append(x)
    elif x%2==0:
        x = x//2
        l.append(x)
    else:
        break
if l[-1]==n:
    print("YES")
    print(len(l))
    print(*l[::-1])
else:
    print("NO")

start, end = map(int, raw_input().split())

def bfs():
    UNDEF = -1
    dist = {start: 1}
    prev = {start: UNDEF}
    q = [start]
    while q:
        curNum = q.pop()
        if curNum == end:
            print 'YES'
            print dist[end]
            path = []
            cur = end
            while cur != UNDEF:
                path.append(cur)
                cur = prev[cur]
            print ' '.join(reversed(map(str, path)))
            return
        for nextNum in (curNum << 1, curNum * 10 + 1):
            if nextNum <= end and nextNum not in dist:
                dist[nextNum] = dist[curNum] + 1
                prev[nextNum] = curNum
                q.append(nextNum)
    print 'NO'

bfs()

def main():
    a, b = map(int, input().split())

    path = [b]
    while b > 0 and b != a:
        if b % 10 == 1:
            b //= 10
        elif b % 2 == 0:
            b //= 2
        else:
            path = None
            break

        path.append(b)

    if not path or path[-1] != a:
        print('NO')
    else:
        print('YES')
        print(len(path))
        print(' '.join([str(x) for x in reversed(path)]))

main()

def multiple(a, b, seq):
    if a == b:
        return seq + [a]
    if a > b:
        return []
    if a < b:
        return multiple(a*2,b,seq + [a]) or multiple((a*10)+1,b,seq + [a])

a,b = map(int,input().split(' '))
res = multiple(a,b,[])
if len(res) == 0:
    print('NO')
else:
    print('YES', len(res), sep='\n')
    print(*res)

a,b=map(int,input().split())
l=[b]
while b>a:
	if b%2==0:
		b=b//2
	elif b%10==1:
		b//=10
	else:
		print("NO")
		exit()
	l.append(b)
if b!=a:
	print("NO")
else:
	print("YES")
	print(len(l))
	print(*(l[::-1]))

def reach(a, b, path=[]):
    if a > b: return
    if a == b:
        path.append(a)
        print("YES")
        print(len(path))
        print(*path)
        exit(0)
    reach(a*2,b,path+[a])
    reach(a*10+1,b,path+[a])
a,b=map(int,input().split())
reach(a,b,[])
print("NO")

n, m = map(int, input().split())
ls = [m]

if m % 10 == 1 or m % 2 == 0:
    while m >= n:
        fl = False
        while m % 2 == 0 and n != m:
            m //= 2
            ls.append(m)
            fl = True
        if m % 10 == 1 and n != m:
            m //= 10
            ls.append(m)
            fl = True
        if not fl:
            if n == m:
                print('YES')
                print(len(ls))
                print(*ls[::-1])
                break
            else:
                print('NO')
                break
    if m < n:
        print('NO')
else:
    print('NO')

a,b=[int(i) for i in input().split()]
op=[]
while b>=a:
    op=[b]+op
    if b%10==1:
        b-=1
        b//=10
    elif b%2==0:
        b//=2
    else:
        break
if a==op[0]:
    print('YES')
    print(len(op))
    print(' '.join([str(i) for i in op]))
else:
    print('NO')

n,m=map(int,raw_input().split())
a=[]
a.append(m)
while n!=m and m>0:
	if m%2==0:
		m/=2
		a.append(m)
	elif m%10==1:
		m/=10
		a.append(m)
	else:
		break
if n==m:
	print "YES"
	print len(a)
	a.reverse()
	for i in a:
		print i,
else:
	print "NO"

def f(a, b, c):
    if (b - 1) % 10 == 0 and (b - 1) / 10 > a:
        return f(a, (b - 1) / 10, str(int(b)) + ' ' + c)
    elif b % 2 == 0 and b / 2 > a:
        return f(a, b / 2, str(int(b)) + ' ' + c)
    elif b / 2 == a or (b - 1) / 10 == a:
        return str(a) + ' ' + str(int(b)) + ' ' + c
    else:
        return False
a, b = list(map(int, input().split()))
d = f(a, b, '')
if d == 0:
    print('NO')
else:
    print('YES')
    print(d.count(' '))
    print(d)

a,b = map(int,input().split())
l = [b]
while b > a:
    if b%2 == 0:
        b//=2
    elif b%10 == 1:
        b -= 1
        b//=10
    else:
        break

    l.append(b)
if b == a:
    l = l[::-1]
    print("YES")
    print(len(l))
    print(" ".join(map(str,l)))
else:
    print("NO")

a,b=list(map(int,input().split()))
A=[b]
Bool=False
while(True):
    if a>=b:
        if a == b:
            Bool = True
        else:
            Bool = False
        break
    else:
        if str(b)[-1]=='1':
            b=int(str(b)[:len(str(b))-1])
            A.append(b)
        else:
            if b % 2 == 0:
                b = b//2
                A.append(b)
            else:
                break
if Bool==False:
    print("NO")
else:
    print("YES")
    print(len(A))
    print(*A[::-1])

# -*- coding: utf-8 -*-

def work(x):
	if (x>a):
		if (x%2==0):
			t = work(x//2)
			if (t < 0): return -1
			f[x] = x//2
			return t+1
		elif (x%10==1):
			t = work(x//10)
			if (t < 0): return -1
			f[x] = x//10
			return t+1
		else: return -1
	elif (x==a): return 0
	else: return -1

def printf(x):
	if (x!=a):
		printf(f[x])
	if (x!=b): print(x,end=' ')
	else: print(x,end='\n')
	return

a, b = input().split(' ')
a = int(a)
b = int(b)
f = {}
ans = work(b)
if ans < 0 : print('NO')
else:
	print('YES')
	print(ans+1)
	printf(b)

digl=['0','1','2','3','4','5','6','7','8','9']
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
mod = 10 ** 9 + 7
a,b=f()
l=[b]
flg=0
while 1:
   if b==1:
      if a==b:
         flg=1
      break
   elif a==b:
      flg=1
      break
   elif b%2==0:
      b//=2
      l.append(b)
   elif b%10==1:
      b//=10
      l.append(b)
   else:
      break
if flg==1:
   print("YES")
   print(len(l))
   print(*(l[::-1]))
else:
   print("NO")

a, b = map(int, input().split())
X = [b]

while a < b:
    if b % 2:
        b, m = divmod(b, 10)
        if m != 1:
            print('NO')
            break
        X.append(b)
    else:
        b //= 2
        X.append(b)
else:
    if a != b:
        print('NO')
    else:
        print('YES')
        print(len(X))
        print(*reversed(X))

# your code here
a,b = map(int,input().split())
v = []
while True:
    v.append(b)
    if b <= a:
        break
    if b % 10 == 1:
        b = (b-1)//10
    elif b % 2 == 0:
        b //= 2
    else:
        break
if v[-1] == a:
    print("YES")
    print(len(v))
    print(*list(reversed(v)))
else:
    print("NO")

import sys
sys.setrecursionlimit(100000)
def prov(a0, a, b, i):
    if a==b and f==0:
        print('YES')
        print(i+1)
        for j in range(i):
            print(a0, end=' ')
            if s1[j]==1:
                a0=2*a0
            else:
                a0=a0*10+1
        print(b)
        global f
        f=1
        return(1)
    elif a>b:
        return(0)
    else:
        i0=i
        s1.append(1)
        prov(a0, 2*a, b, i+1)
        s1.pop()
        s1.append(2)
        prov(a0, a*10+1, b, i0+1)
        s1.pop()
s=list(map(int, input().split()))
a=s[0]
b=s[1]
s1=list();
f=0
t=prov(a, a, b, 0)
if f==0:
    print('NO')

a, b = map(int, input().split())
mass = [b]
while a != b:
	if str(b)[-1] != '1' and b % 2 != 0 and a > b or b == 0:
		print('NO')
		exit()
	else:
		if str(b)[-1] == '1' and len(str(b)) != 1:
			b = int(str(b)[:-1])
		elif b % 2 == 0:
			b = b // 2
		else:
			print('NO')
			exit()
		mass.append(b)
print('YES')
print(len(mass))
print(*mass[::-1])

import copy
import sys
sys.setrecursionlimit(100000)
aa=[]
def abc(a,b,ans):
    if a>b:
        return
    if a==b:
        global aa
        aa=copy.copy(ans)
        return
    x=copy.copy(ans)
    x.append(a*2)
    abc(a*2,b,x)
    x.pop()
    x.append(a*10+1)
    abc(a*10+1,b,x)

a,b=[int(x) for x in raw_input().split()]
abc(a,b,[a])
if len(aa)==0:
    print "NO"
else:
    print "YES"
    print len(aa)
    s=""
    for i in aa:
        s+=str(i)+" "
    print s[:-1]

a,b=map(int,input().split())
l=[b]
while(a<b):
    if b%2:
        if b%10==1:
            b//=10
            l.append(b)
        else:
            break
    else:
        b//=2
        l.append(b)
if a==b:print("YES");print(len(l));print(*l[::-1])
else:print("NO")

line = input().split()
a = int(line[0])
b = int(line[1])
travel = [] #inisialisasi travel untuk menunjukkan asalnya dari mana
travel.append([])
q = [a] #inisialisasi queue utk BFS
index = 0
#proses BFS
while len(q) > 0:
##    print(q[0])
##    print(travel)
##    if q[0] == b: #jika queue terdepan sudah sama
##        print("YES", len(travel[len(travel) - 2]) + 1, sep='\n')
##        for i in travel[len(travel) - 2]:
##            print(i, end=' ')
##        print(q[0])
##        break
##    else:
        temp = q[0] * 2 #proses untuk anak kiri
##        print(len(travel), "index =", index, "travel[index] =", travel[index], "q =", q[0])
##        print(temp, q[0])
        if temp <= b and index < len(travel): #dibatasi tidak melebihi b dan index belum melebihi panjang array travel
            q += [temp] #push data baru
            travel.append([]) #array travel ditambah panjangnya
##            print(len(travel), "index =", index)
            travel[len(travel) - 1] = list(travel[index]) #mengcopy array dari travel asal
            travel[len(travel) - 1] += [q[0]] #travel baru ditambah dengan q[0] untuk menandakan dia berasal dari node tersebut
            if temp == b: #jika temp sudah sama
                print("YES", len(travel[len(travel) - 1]) + 1, sep='\n')
                for i in travel[len(travel) - 1]:
                    print(i, end=' ')
                print(temp)
                break
##            print(temp, "travel kali =", travel[temp], "travel asal =", travel[q[0]], end='-----')
##        elif temp ==
        temp = (q[0] * 10) + 1 #Proses untuk anak kanan
        if temp <= b and index < len(travel):
            q += [temp] #push data baru
            travel.append([]) #array travel ditambah panjangnya
            travel[len(travel) - 1] = list(travel[index]) #mengcopy array dari travel asal
            travel[len(travel) - 1] += [q[0]]
            if temp == b: #jika temp sudah sama
                print("YES", len(travel[len(travel) - 1]) + 1, sep='\n')
                for i in travel[len(travel) - 1]:
                    print(i, end=' ')
                print(temp)
                break
##            print(temp, "travel tambah =", travel[temp], "travel asal =", travel[q[0]])
        q.pop(0) #pop dari queue
        index += 1 #index ditambah menunjukkan asal nodenya
        if len(q) == 0: #jika queue kosong menandakan angka tersebut tidak dapat ditemukan
            print("NO")
#proses DFS
#penelusuran terbalik dari bawah ke atas
##q =[b]
##while b > a:
##    if b % 2 == 0: #jika genap maka pasti merupakan hasil kali 2
##        b = int(b/2) #karena itu dibagi 2
##        q += [b]
##    elif b % 10 == 1: #jika berakhiran 1, merupakan hasil penambahan digit 1 di belakang
##        b = int(b/10) #karena itu dibagi 10
##        q += [b]
##    else: #jika tidak memenuhi keduanya maka sudah pasti angka tersebut mustahil dicapai
##        break
##
##q.reverse() #dibalik untuk pencetakan
##if a == b:
##    print("YES", len(q), sep='\n')
##    for i in q:
##        print(i, end=' ')
##else:
##    print("NO")

n, target = map(int, input().split())

def keep(target, ans):
    #print(target)
    while target % 2 == 0:
        target = target // 2
        ans = [target]+ans
    if str(target).endswith("1") and target != 1:
        return keep((target-1) // 10, [(target-1) // 10]+ans)
    else:
        return target, ans

next, nos = keep(target, [target])

if n in nos:
    print("YES")
    nos = nos[nos.index(n):]
    print(len(nos))
    print(" ".join(str(k) for k in nos))
else:
    print("NO")

a, b = map(int, input().split())

seq = [b]
while b > a:
    if b % 2 == 0:
        b //= 2
        seq.append(b)
    elif b % 10 == 1:
        b //= 10
        seq.append(b)
    else:
        print("NO")
        exit(0)

if b != a:
    print("NO")
else:
    print("YES")
    print(len(seq))
    print(' '.join(map(str, seq[::-1])))

x = input().split()
a = int(x[0])
b = int(x[1])
sp = [b]
k = 1
c = True
while a != b and c == True:
    if b % 10 == 1 :
        b = (b - 1) / 10
        sp.append(int(b))
        k = k + 1
    else:
        b = b / 2
        sp.append(int(b))
        k = k + 1
    if a > b:
        c = False
sp.reverse()
if c == True :
    print("YES")
    print(k)
    print(*sp)
if c == False:
    print("NO")

a,b=map(int,input().split())
f=0
ans=[b]
steps=0
while b>a:
    if b%10==1:
        b=b//10
        ans.append(b)
    elif (b%10)%2==0:
        b=b//2
        ans.append(b)
    else:
        break
    if b==a:
        f=1
        break
if f==1:
    print('YES')
    print(len(ans))
    print(*(ans[::-1]))
else:
    print('NO')

from sys import stdin

a, b = map(int, stdin.readline().split(" "))

processlist = []
processlist.append(b)
posible = True
while a != b:
  if b % 2 == 0:
    b  = b / 2
    processlist.append(b)
  elif b % 10 == 1:
    b = (b - 1) / 10
    processlist.append(b)
  else:
    posible = False
    break

  if b < a:
    posible = False
    break

if posible:
  print "YES"
  print len(processlist)
  processlist.reverse()
  for x in range (len(processlist)):
    print processlist[x],
else:
  print "NO"

a, b = [int(x) for x in input().split()]

lista = []
aux = b
resp = 'NO'
while aux > a:
	lista.append(str(int(aux)))

	if aux % 2 == 0:
		aux /= 2
	else:

		if not ((aux-1) % 10):
			aux = (aux-1) / 10
		else:
			break

	if aux == a:
		resp = 'YES'
		lista.append(str(int(aux)))

if resp == 'YES':
	print(resp)
	print(len(lista))
	lista.reverse()
	print(" ".join(lista))

else:
	print(resp)

A = list(map(int,input().split()))
a = A[0]
b = A[1]
A.clear()
A.append(b)
while b != a:
    if (b-1) % 10 == 0 and b >= a:
        b = (b-1)//10
        A.append(b)
    elif b % 2 == 0 and b >= a:
        b = b//2
        A.append(b)
    else:
        break
if a == b:
    A = sorted(A)
    print('YES')
    print(len(A))
    print(*A,sep = ' ')
else:
    print('NO')

a, b = map(int, input().split())
X = [b]

while a < b:
    if b % 2:
        b, m = divmod(b, 10)
        if m != 1:
            print('NO')
            break
        X.append(b)
    else:
        b //= 2
        X.append(b)
else:
    if a != b:
        print('NO')
    else:
        print('YES')
        print(len(X))
        print(*reversed(X))

a,b = map(int,input().split())
r = [b]
while b>a:
    if b%2==0:
        b=b//2
    else:
        if str(b)[-1]=='1':
            b = int(str(b)[:-1])
        else:
            print('NO')
            break
    r.append(b)
else:
    if b==a:
        print('YES')
        print(len(r))
        print(*(r[::-1]))
    else:
        print('NO')

a, b = [int(i) for i in input().split()]
s = str(b)
while b > a:
    if str(b)[-1] == '1':
        b = b // 10
        s += ' ' + str(b)
    elif b % 2 == 0:
        s += ' ' + str(b // 2)
        b = b // 2

    else:
        break
if b == a:
    print('YES')
    print(s.count(' ') + 1)
    print(' '.join(s.split()[::-1]))
else:
    print('NO')

from collections import *
from math import *

a,b = list(map(int,input().split()))
ans = [b]
while(b > a):
	if(b%10 == 1):
		b //= 10
	elif((b%10)&1):
		print("NO")
		exit(0)
	else:
		b //= 2
	ans.append(b)
if(a != b):
	print("NO")
else:
	print("YES")
	ans = ans[::-1]
	print(len(ans))
	print(*ans)

a,b = map(int,input().split())
flag = 0
i = 1
t = [b]
while True:
	if b < a:
		flag = 1
		break
	elif b == a:
		break
	if (b)%2 == 0:
		b = b//2
		t.append(b)
	elif b%10 == 1:
		b = b//10
		t.append(b)
	elif b%2 == 1 and b != a:
		flag = 1
		break
	i = i + 1
if flag == 0:
	print("YES")
	print(i)
	for i in range(1,len(t)+1):
		print(t[-i],end=" ")
else:
	print("NO")

a,b=list(map(int,input().split()))
tmp=b

arr=[str(b)]
c=0
while(tmp>=a):
	if(tmp==a):
		print("YES")
		print(len(arr))
		arr=arr[::-1]
		print(' '.join(arr))
		exit()

	if(tmp%2!=0):
		if(str(tmp)[-1]!='1'):
			print("NO")
			exit()
		else:
			tmp=int(str(tmp)[:-1])
	else:
		tmp=tmp//2

	arr.append(str(tmp))
	# c+=1
print("NO")

def Do():
    global a,b,A,t
    while t==0:
        bb=str(b)[-1]
        if bb=='1':
            b=int(str(b)[:-1])
            A.append(b)
        elif b%2==0:
            b=b//2
            A.append(b)
        else:
            t=2
        if b==a:
            t=1
        elif b<a:
            t=2
a,b=map(int,input().split())
t=0
A=[b]
Do()
if t-1:
    print('NO')
else:
    x=len(A)
    print("YES")
    print(x)
    for i in range(x-1,-1,-1):
        print(A[i],end=' ')

a, b = map (int, input().split())
c=[str(b)]
while b>a:
    if b%10==1 and b!=1:
        b//=10
        c.append(str(b))
    elif b%2==0:
        b//=2
        c.append(str(b))
    if b==a:
        print('YES', len(c), ' '.join(c[::-1]), sep='\n')
        break
    elif (b%2!=0 and b%10!=1) or b<a:
        print('NO')
        break

import sys
sys.setrecursionlimit(10**7)

def dfs(nu,par):
	global b,di
	if int(nu) > int(b):
		return 0
	if nu not in di:
		if nu == b:
			return 1
		else:
			if dfs(str(int(nu)*2),nu):
				di[str(int(nu)*2)] = nu
				return 1
			elif dfs(nu+'1',nu):
				di[nu+'1'] = nu
				return 1
			else:
				return 0
	else:
		return 0

di = {}
a,b = raw_input().split()
if dfs(a,-1):
	count = 0
	lis = []
	lis.append(b)
	while(b !=  a):
		b = di[b]
		count += 1
		lis.append(b)

	print 'YES'
	print count+1
	for ele in lis[::-1]:
		print ele,

else:
	print 'NO'

def solve():
    nums = map(int, raw_input().split(" "))
    a, b = nums
    steps = []
    while b > a:
        steps.insert(0, b)
        if b % 2 == 0:
            b = b / 2
        elif b % 10 == 1:
            b = (b-1) / 10
        else:
            return "NO"

    if b != a:
        return "NO"

    steps.insert(0, a)

    return "YES\n" + str(len(steps)) + "\n" + " ".join(map(str, steps))

print solve()

a,b=map(int,input().split())
path=[]
def recurs(n):
    global path
    global a
    if n==a:
        return True
    if n<a:
        return False
    if n%2==0:
        x=recurs(n//2)
        path.append(n)
        if x==True:
            return True
        path.pop()
    if (n-1)%10==0:
        x=recurs((n-1)//10)
        path.append(n)
        if x==True:
            return True
        path.pop()
    return False
x=recurs(b)
if x==True:
    print('YES')
    print(len(path)+1)
    print(a,end=' ')
    for i in range(len(path)):
        print(path[i],end=' ')
else:
    print('NO')

def make_a_into_b(a, b):
    if a == b:
        return [a]
    elif a > b:
        return None
    else:
        one = make_a_into_b(a * 2, b)
        another = make_a_into_b(10 * a + 1, b)

        if one is None and another is None:
            return None
        elif one is None:
            result = another
        elif another is None:
            result = one
        else:
            result = min(one, another, key=len)

        result.append(a)

        return result

a, b = map(int, raw_input().split(' '))

result = make_a_into_b(a, b)

if result is not None:
    print "YES"
    print len(result)
    print ' '.join(map(str, reversed(result)))
else:
    print "NO"

# cook your dish here
a, b = [int(x) for x in input().split()]

r = []
r.append(b)
if b & 1:
    b -= 1
    b = b // 10
    r.append(b)
while b != 0:
    if b < a:
        break
    if b == a:
        break
    if b & 1:
        b -= 1
        b = b // 10
    else:
        b = b // 2
    r.append(b)
if b == a:
    print("YES")
    print(len(r))
    r = sorted(r)
    for x in range(len(r)):
        print(r[x], end=' ')
else:
    print("NO")

import math
a,b=[int(i) for i in raw_input().split()]
f=0
l=[b]
while b>a:
    if str(b)[::-1][0]=='1':
        b=int(str(b)[:len(str(b))-1])
        l.append(b)
    elif b%2==0:
        b=b/2
        l.append(b)
    else:
        f=0
        break
if b==a:
    print "YES"
    for i in l[::-1]:
        print i,
else:
    print "NO"

a,b = map(int,input().split())
flag = 0
i = 1
t = [b]
while True:
	if b <= 2:
		print()

	if b < a:
		flag = 1
		break
	elif b == a:
		break
	if (b)%2 == 0:
		b = b//2
		t.append(b)
	elif b%10 == 1:
		b = b//10
		t.append(b)
	elif b%2 == 1 and b != a:
		flag = 1
		break
	i = i + 1
if flag == 0:
	print("YES")
	print(i)
	for i in range(1,len(t)+1):
		print(t[-i],end=" ")
else:
	print("NO")

a, b = list(map(int, input().split()))
arr = [str(b)]
while b > a:
    if b % 10 == 1:
        b //= 10
        arr.append(str(b))
    elif b % 2 == 0:
        b //= 2
        arr.append(str(b))
    else:
        b = -1
if b == a:
    print('YES', len(arr), ' '.join(arr), sep='\n')
else:
    print('NO')

a,b=map(int,input().split())
k=[b]
while b>a:
    if b%2==0:
        b=int(b/2)
        k.append(b)
    else:
        b=int(b//10)
        k.append(b)
k.reverse()
if min(k)==a:
    print('YES')
    print(len(k))
    for item in k:
        print(item, end=" ")
else:
    print('NO')

a,n=map(int,input().split())
ans  = []
j = 0
z = 0
for g in range(a):
     s = str(n)
     if s[-1] == "1":
          s = s[0:len(s)-1]
          if s != "":
               n = int(s)

          ans.append(n)
          j += 1

          if n == a:
               z = 1
               break
     if n % 2 == 0:
          n = n // 2
          ans.append(n)
          j += 1
          if n == a:
               z = 1
               break
t = 1
if z == 0:
     print("NO")
else:
     print("YES")
     print(j+1)
     for i in range(len(ans)-1,-1,-1):
          print(ans[i], end=" ")

     print(ans[0]*2)

a,b = map(int,raw_input().split())
l = []
l.append(a)
while True:
	if a > b:
		print "NO"
		print l
		break
	if a == b:
		print "YES"
		for i in l:
			print i,
		break
	if b%a == 0:
		a *= 2
		l.append(a)
	elif b%(10* a +1) == 0 or b%(10* a+1) == 1:
		a = 10* a +1
		l.append(a)
	else:
		a *= 2
		l.append(a)

"""
// Author : snape_here - Susanta Mukherjee

 """

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())

def read():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

mod=1000000007

import math

def main():

    a,b=mi()
    l=[]
    while(b!=a):
        l.append(b)
        if b%10==1:
            b=str(b)
            b=b[0:len(b)-1]
            b=int(b)
        else:
            b//=2
        if a>b:
            print("NO")
            exit()
    l.append(a)
    print("YES")
    print(len(l))
    l.reverse()
    print(*l)

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()

def com1(x):
    return 2*x

def com2(x):
    return 10 * x + 1

def decom2(x):
    return (x - 1) // 10

def decom1(x):
    return x // 2

a,b = map(int, input().split())
test = b
list1 = [b]

while (test >= 1) and (test != a):
    if test % 10 == 1:
        test = decom2(test)
    else:
        test = decom1(test)
    list1.append(test)

if test == a:
    print('YES')
    print(len(list1))
    for i in range(-1,-len(list1)-1,-1):
        print(list1[i], end = ' ')
else:
    print('NO')

n,m = map(int,input().split())
l = []
l.append(m)

while m>0:
    if m%2==1:
        m=m//10
    else:
        m=m//2
    l.append(m)
    if m==n:
        print("YES")
        print(len(l))
        print(*l[::-1])
        exit()
print("NO")

import sys

[a, b] = [int(x) for x in sys.stdin.readline().split()]
res = []

while b > a:
	res.append(b)

	if b % 2 == 0:
		b /= 2
	elif b % 10 == 1:
		b /= 10
	else:
		break

if b != a:
	print "NO"
	sys.exit(0)

res.append(a)
res.reverse()

print "YES"
print ' '.join([str(x) for x in res])

# Breno Souza

a, b = map(int, raw_input().split())

possivel = False
etapas = [b]

while True:
	if (a == b):
		print "YES"
		possivel = True
		break
	elif (a > b):
		print "NO"
		break
	elif (b % 2 == 0):
		b /= 2
		etapas.append(b)
	else:
		b = (b - 1)/10
		etapas.append(b)

print len(etapas)
etapas.reverse()

if (possivel):
	for etapa in etapas:
		print etapa,

a,b=map(int,input().split())
r=[b]
while b>a:
    if b%10==1:
        b=b//10
        r.append(b)
    else:
        b=b//2
        r.append(b)
if r[len(r)-1]==a:
        print('YES')
        print(len(r))
        print(*r[::-1])
else:
        print('NO')

a, b = map(int, input().split())
C = []
C.append(b)
while a < b:
    if b % 10 == 1:
        b = (b - 1) // 10
        C.append(b)
    else:
        b = b // 2
        C.append(b)
C = list(reversed(C))
if C[0] == a:
    print("YES")
    print(*C)
else:
    print("NO")

s = input()
s += " "
k = 0
a = ""
b =""
for i in s:
    if k == 0:
        if i != ' ':
            a += i
        else:
            k += 1
    elif k == 1:
        if i != ' ':
            b += i
a1 = []
b1 = []
a1 += a
b1 += b
a2 = int(a)
b2 = int(b)
y1 = b
y = []
while b2 > a2:
    if (b2 - 1) % 10 == 0:
        b2 = int((b2 - 1) / 10)
        y.append(b2)
    else:
        if b2 % 2 == 0:
            b2 = int(b2 / 2)
            y.append(b2)
        else:
            print("NO")
            break
if b2 == a2:
    print("YES")
    print(len(y) + 1)
    y = y[::-1]
    for i in y:
        print(i, end=" ")
    print(y1)
else:
    print("NO")

# cook your dish here
a, b = [int(x) for x in input().split()]

r = []
r.append(b)
if b & 1:
    b -= 1
    b = b // 10
    r.append(b)
while b != 0:
    if b < a:
        break
    if b == a:
        break
    if b & 1:
        b -= 1
        b = b // 10
    else:
        b = b // 2
    r.append(b)
if b == a:
    print("YES")
    r = sorted(r)
    for x in range(len(r)):
        print(r[x], end=' ')
else:
    print("NO")

a,b=map(int,input().split())
c=0;k=0;s=''
while a!=b and c==0 and b!=0:
    if b%10==1:
        b=b//10
        s=s+'1'
    else:
        if b%2==1:
            c=1
        else:
            b=b//2
            s=s+'2'
    k+=1
if c==0 and b!=0:
    print('YES')
    print(k+1)
    print(a,end=' ')
    for i in range(k):
        if int(s[len(s)-1-k])==1:
            print(a*10+1,end='')
            a=a*10+1
        else:
            print(a*2,end=' ')
            a=a*2
else:
    print('NO')

a,b = map(int,input().split())
lst = []
while b > a:
    lst.append(b)
    if str(b)[-1] == '1':
        b = int(str(b)[:-1])
    else:
        b //= 2

lst.append(a)
if b == a:
    print('YES')
    print(*lst[::-1])
else:
    print('NO')

a,b=map(int,input().split())
used=[]
while a!=b:
    if b%10==1:
        used.append(b)
        b=(b-1)//10
    elif b%2==0:
        used.append(b)
        b=b//2
    else:
        break

a, b = map(int, input().split())
steps = list()
steps.append(b)
Done = False
while b != a:
    if (b - 1)%10 == 0:
        b = (b-1)//10
        steps.append(b)
    if b % 2 == 0:
        b = b//2
        steps.append(b)
    if (b - 1)%10 != 0 and b % 2 != 0:
        print('NO')
        Done = True
        break
if Done is False:
    print('YES')
    print(len(steps))
    print(list(reversed(steps)))

n,k=list(map(int,input().split()))
answer=[]
answer.append(k)
f=0
def w(x):
    global n
    global f
    if x==n:
        print('YES')
        print(len(answer))
        l=len(answer)
        f=1
        for i in range(l):
            print(answer[l-i-1],' ',end='')

while k>n:
    if k%2==0:
        k=k//2
        answer.append(k)
    if k%10==1:
        k=(k-1)//10
        answer.append(k)
    if k==n:
        print('YES')
        print(len(answer))
        l=len(answer)
        for i in range(l):
            print(answer[l-i-1],' ',end='')
        break
    elif (k%2!=0 and k%10!=1) or k<n:
        print('NO')
        break

a,b=map(int,input().split())
c=[b]
flag=0
while b>a:
    if b%2==0:
        b=b//2
    elif b%10==1:
        b=b//10
    else:
        print("NO")
        break
    c.append(b)
    if b==a:
        flag=1
        c.reverse()
        print(len(c))
        for i in range(len(c)):
            print(c[i],end=" ")
if flag==0:
    print("NO")

def main():
    a, b = map(int, input().split())

    path = [b]
    while b > 0 and b != a:
        if b % 10 == 1:
            b //= 10
        elif b % 2 == 0:
            b //= 2
        else:
            path = None
            break

        path.append(b)

    if not path or path[-1] != a:
        print("NO")
    else:
        print(' '.join([str(x) for x in reversed(path)]))

main()

a,b = map(int,input().split())
Flag = True
c = [b]
while a != b and Flag:
    if b % 10 == 1:
        b = b // 10
        c.append(b)
    elif b % 2 == 0 and b != 0:
        b = b // 2
        c.append(b)
    else:
        Flag = False
if Flag:
    print ('Yes')
    print (len(c))
    print (c[::-1])
else:
    print ('No')

a, b = map(int, raw_input().split())

vector = []
ok = True

while b > a:
    vector.append(b)
    if b % 2 == 0:
        b = b/2
    elif b % 10 == 1:
        b = b/10
    else:
        break

if b!=a:
    ok = False
else:
    vector.append(a)

if not ok:
    print "NO"
else:
    print "YES"
    print len(vector)

    for i in xrange(len(vector)-1, 0, -1):
        print str(vector[i]),
        print vector[0]

import sys

a, b = sys.stdin.readline().strip().split()
a, b = int(a), int(b)

mas = []

while b>=a:
    mas += [b]
    if b % 2 == 0:
        b=b/2
    else:
        b=(b-1)/10
mas.reverse()

if a==mas[0]:
    print "YES"
    print len(mas)
    print " ".join(map(str, mas))
else:
    print "NO"

(a,b) = map(int,raw_input().split())
anmas = [b]

while b>a:
    if b%2==0:
        b/=2
        anmas.append(b)
    elif b%10==1:
        b/=10
        anmas.append(b)
    else:
        print "NO"
        break

if b==a:
    anmas.append(b)
    anmas.reverse()
    print "YES"
    print len(anmas)
    print ' '.join(map(str,anmas))

lst = list(map(int, input().split()))
b = lst[0]
a = lst[1]
k = 0
lst = []
while a != b:
    lst.append(a)
    if a % 2 != 0  and a % 10 != 1:
        print('No')
        break
    elif a < b:
        print('No')
        break
    elif a % 10 == 1:
        a = a // 10
        k += 1
    else:
        a = a // 2
        k += 1
    if a == b:
        lst.append(a)
        lst.reverse
        print('Yes')
        print(len(lst))
        for i in range(len(lst)):
            print(lst[i], end=' ')

a , b = map(int,input().split())
lastDigit = b%10
if lastDigit in [3,5,7,9]:
    print("NO")
else:
    ans = 0
    transform = [b]
    while a < b:
        lastDigit = b % 10
        if lastDigit in [3,5,7,9]:
            print("NO")
            exit()
        ans+=1
        if lastDigit==1:
            b = b//10
            transform.append(b)
        else:
            b//=2
            transform.append(b)
    print(transform)
    if b == a:
        print("YES")
        print(len(transform))
        transform.reverse()
        for i in transform:
            print(i,end=' ')
        print()
    else:
        print("NO")

x = input().split()
a = int(x[0])
b = int(x[1])
sp = [b]
k = 1
c = True
while a != b and c == True:
    if b % 10 == 1 :
        b = (b - 1) / 10
        sp.append(b)
        k = k + 1
    else:
        b = b / 2
        sp.append(b)
        k = k + 1
    if a > b:
        c = False
sp.reverse()
if c == True :
    print("YES")
    print(k)
    print(*sp)
if c == False:
    print("NO")

cin = input().split(" ")
a = int(cin[0])
b = int(cin[1])
x = []
while (b > a):
    x.append(b)
    if (b % 10 == 1):
        b = (b - 1) // 10
    elif (b % 2 == 0):
        b //= 2
    else:
        print("NO")
        break
x.append(b)
if (b == a):
    x.reverse()
    for i in x:
        print(i, end = " ")
else:
    print("NO")

a,b=map(int,input().split())
S=[]
k=0
Z=''
while b>a :
    S.append(str(b))
    if b%2==0 :
        b=b//2
    else :
        b=(b-1)/10
    k=k+1
S.append(str(b))
for i in range(k+1) :
    Z=S[i]+' '+Z
if a==b :
    print('YES')
    print(k+1)
    print(Z)
else :
    print('NO')

def solve(n, prev):
    if n > b:
        return
    if n == b:
        print("YES")
        print(len(prev))
        print(*prev)
        exit()
    solve(n * 2, prev + [n * 2])
    solve(n * 10 + 1, prev + [n * 10 + 1])

a, b = list(map(int, input().split()))

solve(a, [])
print("NO")

a , b = map(int,input().split())
lastDigit = b%10
if lastDigit in [3,5,7,9]:
    print("NO")
else:
    ans = 0
    transform = [b]
    while a < b:
        lastDigit = b % 10
        ans+=1
        if lastDigit==1:
            b = b//10
            transform.append(b)
        else:
            b//=2
            transform.append(b)
    if b == a:
        print("YES")
        print(len(transform))
        transform.reverse()
        for i in transform:
            print(i,end=' ')
        print()
    else:
        print("NO")

a, b = map(int, raw_input().split())

seq = [b]
while b > a:
    if b % 10 == 1:
        b /= 10
    else:
        b /= 2
    seq.append(b)

if a == b:
    print "YES"
    print len(seq)
    print " ".join(map(str, reversed(seq)))
else:
    print "NO"

a, b = map(int, input().split())
R = [b]
while b > 0:
    while b % 2 == 0:
        b //= 2
        R.append(b)
        if b == a:
            print('YES')
            print(*R[::-1])
            exit()
    if b % 10 == 1:
        b //= 10
        R.append(b)
        if b == a:
            print('YES')
            print(*R[::-1])
            exit()
    else:
        print('NO')
        exit()
print('NO')

a,b=map(int,input().split())
l=[b]
while(a<b):
    if b%2:
        if b%2==1:
            b//=10
            l.append(b)
        else:print("NO");exit();
    else:
        b//=2
        l.append(b)
if a==b:print("YES");print(len(l));print(*l[::-1])
else:print("NO")

import sys, math
input = sys.stdin.readline

a, b = map(int, input().split())

def solve(n, p):
  if n == a:
    return p
  elif str(n)[-1] == "1" and len(str(n)) > 1:
    return solve(int(str(n)[:-1]), p + [n])
  elif not n % 2:
    return solve(n / 2, p + [n])
  else:
    return False

ans = solve(b, [])
if not ans:
  print "NO"
else:
  print str(a) + " " + " ".join(map(str, ans[::-1]))

n,k=map(int, input().split())
c=[]
count=0
while(1):
    if(n==k):
        c.append(k)
        count+=1
        break
    if(k%2==0):
        k=k/2
        c.append(k)
        count+=1
    else:
        k=(k-1)/10
        c.append(k)
        count+=1
if(n==k):
    print("YES")
    print(str(count))
    c=c[::-1]
    string=""
    for i in c:
        string+=str(i)+' '
    print(string)
    # print(c[::-1])
else:
    print("NO")

import sys

a, b = sys.stdin.readline().strip().split()
a, b = int(a), int(b)

mas = []

while b>=a:
    mas += [b]
    if b % 2 == 0:
        b=b/2
    else:
        b=(b-1)/10

print mas
mas.reverse()
print mas

if a==mas[0]:
    print "Yes"
print len(mas)
print " ".join(map(str, mas))

a,b = map(int,raw_input().split())
l = []
l.append(a)
while True:
	if a > b:
		print "NO"
		break
	if a == b:
		print "YES"
		print len(l)
		for i in l:
			print i,
		break
	if b%a == 0:
		a *= 2
		l.append(a)
	elif b%(10* a +1) == 0 or b%(10* a+1) == 1:
		a = 10* a +1
		l.append(a)
	else:
		a *= 2
		l.append(a)

a,b=raw_input().split()
a,b=int(a),int(b)
out=[b,]
while a<b:
	if b%2==0:
		b/=2
		out.append(b)
	elif (b-1)%10==0:
		b=(b-1)/10
		out.append(b)
	else:
		break
if a==b:
	print "Yes"
	print len(out)
	for i in reversed(out):
		print i,
else:
	print "NO"

a,b=map(int,raw_input().split())
ans=[]
while b > a:
    if b&1:
        if b%10 == 1:
            ans.append(b)
            b-=1
            b/=10
        else:
            print "NO"
            exit(0)
    else:
        ans.append(b)
        b/=2
if a != b:
    print "NO"
    exit(0)
print " ".join(map(str, (ans+[a])[::-1]))

a, b = map(int, input().split())
ans = [b]
while True:
    if b % 10 == 1:
        b //= 10
    elif b % 2 == 0:
        b //= 2
    else:
        break
    if a >= b:
        break
    ans.append(b)
ans.append(a)
if a != b:
    print("NO")
else:
    print("YES", '\n', len(ans), '\n', *ans[::-1])

def f(a, b, c):
    if (b - 1) % 10 == 0 and (b - 1) / 10 > a:
        return f(a, (b - 1) / 10, str(int(b)) + ' ' + c)
    elif b % 2 == 0 and b / 2 > a:
        return f(a, b / 2, str(int(b)) + ' ' + c)
    elif b / 2 == a or (b - 1) / 10 == a:
        return str(int(b)) + ' ' + c
    else:
        return False
a, b = list(map(int, input().split()))
d = f(a, b, '')
if d == 0:
    print('NO')
else:
    print('YES')
    print(d.count(' ') - 1)
    print(d)

s = input()
s += " "
k = 0
a = ""
b =""
for i in s:
    if k == 0:
        if i != ' ':
            a += i
        else:
            k += 1
    elif k == 1:
        if i != ' ':
            b += i
a1 = []
b1 = []
a1 += a
b1 += b
a2 = int(a)
b2 = int(b)
y = b2
q = []
while b2 > a2:
    if b1[-1] == "1":
        b1.remove(b1[-1])
        b3 = 0
        b4 = ""
        for i in b1:
            b4 += i
        b3 = int(b4)
        b2 = b3
        q.append(b2)
    else:
        if b2%2==0:
            b2 = int(b2/2)
            b1 = []
            b1 += str(b2)
            q.append(b2)
        else:
            print("NO")
            break
if b2 == a2:
    print("YES")
    print(len(q) + 1)
    q = q[::-1]
    for i in q:
        print(i, end=" ")
    print(y)
else:
    print("NO")

a, b = map(int, input().split())
was = []
was += [b]
while b > a:
    if b % 2 == 0:
        was = was + [b // 2]
        b = b // 2
    else:
        was += [b // 10]
        b = b // 10
if b == a:
    print("YES")
    print(len(was))
    was1 = was[::-1]
    print(*was1)
else:
    print("NO")

a,b = map(int,raw_input().split())

steps = list()

steps.append(b)

while (b > a):
    if (b % 10 == 1):
        b = b / 10
        steps.append(b)
    elif (b % 2 == 0):
        b = b / 2
        steps.append(b)
    else:
        print 'NO'
        exit()

if (b==a):
    print len(steps)
    for x in reversed(steps):
        print x,
else:
    print 'NO'

a,b = map(int,input().split())
res = []
while (b!=a and b):
  res.append(b)
  if b%10 == 1:
    b = b-1
    b = b//10
  elif b%2 == 0:
    b = b//2
  else:
    break
if b!=a:
  print("No")
else:
  print("Yes")
  res = res + [a]
  print(len(res))
  print(*res[::-1])

def com1(x):
    return 2*x

def com2(x):
    return 10 * x + 1

def decom2(x):
    return x // 10

def decom1(x):
    return x // 2

a,b = map(int, input().split())
test = b
list1 = [b]

while (test > 1) and (test != a):
    if test % 2 == 1:
        test = decom2(test)
    else:
        test = decom1(test)
    list1.append(test)

if test == a:
    print('YES')
    print(len(list1))
    for i in range(-1,-len(list1)-1,-1):
        print(list1[i], end = ' ')
else:
    print('NO')

a,b = map(int,input().split())
bstart = b
shit = False
result = []
while not shit and b > a:
    if b % 10 != 1:
        if b % 2 == 1:
            shit = True
        else:
            b = b // 2
            result.append(b)
    else:
        if b // 10 == 0:
            shit = True
        else:
            b = (b - 1)//10
            result.append(b)
if not shit and b == a:
    print("YES")
    print(len(result) + 1)
    print(bstart,*result, sep=' ')
else:
    print("NO")

a,b=input().split()
a=int(a)
b=int(b)
f=0
l=[]
while(b>a):
    if (b%2==1):
        if (b-1)%10==0:
            l.append(b)
            b=(b-1)//10
        else:
            print("NO")
            f=1
            break
    else:
        l.append(b)
        b=b//2
if (f==0):
    if a==b:
        print("YES")
        l.append(a)
        for i in range (len(l)):
              print(l[len(l)-i-1],end=' ')
    else:
        print("NO")

a, b = map(int, input().split())
C = []
C.append(b)
while a < b:
    if b % 10 == 1:
        b = (b - 1) // 10
        C.append(b)
    else:
        b = b // 2
        C.append(b)
C = list(reversed(C))
if C[0] == a:
    print("YES")
    print(C)
else:
    print("NO")

a = input()
s = []
T = ''
b = 0

b = a[a.find(' ')+1:]
a = a[0:a.find(' ')]

a = int(a)
b = int(b)

s.append(b)
#print(a)
#print(b)
try:
    if(b>a):
        for i in range(a,b):
            if(b%2 != 0):
                b = int((b - 1)/10)
                s.append(b)
            else:
                b = int(b / 2)
                s.append(b)
            if(b == a):
                T = 'YES'
                break
            elif(b<a):
                T = 'NO'
                break
        if(T == 'YES'):
            s.reverse()
            print(T)
            print(len(s))
            print(s)
        else:
            print(T)
except(TypeError, ValueError):
    print('Error')

b,a=map(int,input().split())
l=[a]
while b!=a:
	if a<=0:
		print('NO')
		break
	if str(a)[-1]=='1':
		a=(a-1)//10
	elif a%2==0:
		a=a//2
	else:
		print('NO')
		break
	l.append(a)
else:
	print('YES')
	l.sort()
	print(*l)

a, b = map(int, input().split())
res = [b]
while b >= a:
    if b == a:
        print("YES")
        res.reverse()
        print(*res)
        exit()
    if str(b)[-1] == "1":
        b = (b - 1) // 10
    elif b % 2 == 0:
        b = b // 2
    else:
        break
    res.append(b)
print("NO")

n,k=map(int,input().split())
l1=[]
l1.append(k)
while(True):
    if(k%2!=0 and k%10!=1):
        print("NO")
        break
    elif(k%2==0):
        k=int(k/2)
        l1.append(k)
    elif(k%10==1):
        k=int(k/10)
        l1.append(k)
    if(k==n or k<n):
        break
if(k==n):
    print("YES")
    print(len(l1))
    l1.sort()
    for i in range (len(l1)):
        print(l1[i],end=" ")
else:
    print("NO")

import sys
import copy

def op1(n):
	return n*2
def op2(n):
	return (n*10)+1
def revop1(n):						# 0
	return n/2
def revop2(n):						# 1
	return (n-1)/10

a,B=map(int,filter(lambda a:a!='',raw_input().split(' ')))
# print a,b
operations=[]
b=copy.copy(B)
while b>a:
	if b%2==0:
		b=revop1(b)
		operations.append(0)
	else:
		b=revop2(b)
		operations.append(1)
if b==a:
	print 'YES'
	print len(operations)+1
	sys.stdout.write('%d '%a)
	for i in range(len(operations)-1,-1,-1):
		if operations[i]==0:
			a=op1(a)
		elif operations[i]==1:
			a=op2(a)
		sys.stdout.write('%d '%a)
	sys.exit(0)
else:
	print 'NO'
	sys.exit(0)

def fib(n):
	if n <= 2:
		return n
	else:
		return fib(n - 1) + fib(n - 2)
print(fib(20))

a,b = map(int,input().split())
l = [b]
while b % 2 == 0 or b % 10 == 1:
    print("i")
    if b == a:
        print(1)
        break
    elif b % 2 == 0:
        print(2)
        b = int(b/2)
        l.append(b)
    else:
        print(3)
        b = int((b-1)/10)
        l.append(b)

if b == a:
    print("YES")
    print(len(l))
    print(*reversed(l))
else:
    print("NO")

def com1(x):
    return 2*x

def com2(x):
    return 10 * x + 1

def decom2(x):
    return x // 10

def decom1(x):
    return x // 2

a,b = map(int, input().split())
test = b
list1 = [b]

while (test >= 1) and (test != a):
    if test % 2 == 1:
        test = decom2(test)
    else:
        test = decom1(test)
    list1.append(test)

if test == a:
    print('YES')
    print(len(list1))
    for i in range(-1,-len(list1)-1,-1):
        print(list1[i], end = ' ')
else:
    print('NO')

IN = [int(i) for i in input().split()]
OUT = []

while IN[1] > IN[0]:
    if IN[1] % 2 == 1:
        OUT.append(IN[1])
        IN[1] = int((IN[1] - 1) / 10)
    else :
        OUT.append(IN[1])
        IN[1] = int(IN[1]/2)

if IN[0] == IN[1]:
    OUT.append(IN[0])
    OUT.reverse()
    print('YES')
    print(len(OUT))
    for i in OUT:
        print(i, end = " ")
else:
    print('NO')

import sys

[a, b] = [int(x) for x in sys.stdin.readline().split()]
res = []

while b > a:
	res.append(b)

	if b % 2 == 0:
		b /= 2
	elif b % 10 == 1:
		b /= 10
	else:
		break

if b != a:
	print "NO"
	sys.exit(0)

res.append(a)
res.reverse()

print "YES"
print ' '.join([str(x) for x in res])

a, b = map(int, raw_input().split())

vector = []
ok = True

while b > a:
    vector.append(b)
    if b % 2 == 0:
        b = b/2
    elif b % 10 == 1:
        b = b/10
    else:
        break

if b!=a:
    ok = False
else:
    vector.append(a)

if not ok:
    print "NO"
else:
    print "YES"

for i in xrange(len(vector)-1, 0, -1):
    print str(vector[i]),

print vector[0]

nums = raw_input().split()
a = int(nums[0])
b = int(nums[1])
steps = []

def step(a, b):
  if a > b:
    return False
  elif a == b:
    steps.append(str(a))
    return True
  else:
    if step(a*2, b):
      steps.append(a)
      return True
    elif step(a*10+1,b):
      steps.append(a)
      return True
    else:
      return False

if step(a, b):
  print 'YES'
  print len(steps)
  steps.sort()
  steps = [str(i) for i in steps]
  print ' '.join(steps)

a, b = map(int, input().split())
C = []
C.append(b)
while a < b:
    if b % 10 == 1:
        b = (b - 1) // 10
        C.append(b)
    else:
        b = b // 2
        C.append(b)
C = list(reversed(C))
if C[0] == a:
    print("YES")
    print(*C)
else:
    print("NO")

a,b=map(int,input().split())
c=0;k=0;s='';
while a!=b and c==0 and b>a:
    if b%10==1:
        b=b//10
        s=s+'1'
    else:
        if b%2==1:
            c=1
        else:
            b=b//2
            s=s+'2'
    k+=1
print(s)
if c==0 and b==a:
    print('YES')
    print(k+1)
    print(a,end=' ')
    for i in range(k):
        if (s[len(s)-1-i])=='1':
            print(a*10+1,end=' ')
            a=a*10+1
        else:
            print(a*2,end=' ')
            a=a*2
else:
    print('NO')

# cook your dish here
a, b = [int(x) for x in input().split()]

r = []
r.append(b)
if b & 1:
    b -= 1
    b = b // 10
    r.append(b)
while b != 0:
    if b < a:
        break
    if b == a:
        break
    if b & 1:
        b -= 1
        b = b // 10
    else:
        b = b // 2
    r.append(b)
if b == a:
    print("YES")
    r = sorted(r)
    for x in range(len(r)):
        print(r[x], end=' ')
else:
    print("NO")

n,k=map(int, input().split())
c=[]
count=0
while(k>=n):
    if(n==k):
        c.append(k)
        break
    if(k%2==0):
        c.append(k)
        k=k//2

        # count+=1
    else:
        c.append(k)
        k=(k-1)//10

        # count+=1
if(n==k):
    print("YES")
    print(len(c))
    c=c[::-1]
    # string=""
    # print("{0}".format(" ".join(c)))
    print(*c, sep=' ')
    # print(c[::-1])
else:
    print("NO")

a,b=map(int,input().split())
l=[b]
while(a<b):
    if b%2:
        b//=10
        l.append(b)
    else:
        b//=2
        l.append(b)
if a==b:print("YES");print(len(l));print(*l[::-1])
else:print("NO")

str=input()
mas1=str.split()
a=int(mas1[0])
b=int(mas1[1])
k=1
i=0
mas=[]
while (a<b):
    mas.append(b)
    if b%2==0:
        b=b//2
        k=k+1
    else:
        b=(b-1)//10
        k=k+1
mas.reverse()
f=len(mas)
if (a==b):
    print("YES")
    print(k)
    print (a,end=' ')
    while i<f:
        print (mas[i],end=' ')
        i+=1
else: print("NO")

n,k=map(int, input().split())
c=[]
count=0
while(1):
    if(n==k):
        c.append(k)
        count+=1
        break
    if(k%2==0):
        k=k/2
        c.append(k)
        count+=1
    else:
        k=(k-1)/10
        c.append(k)
        count+=1
if(n==k):
    print("YES")
    print(str(count))
    c=c[::-1]
    string=""
    for i in c:
        string+=str(i)+' '
    print(string)
    # print(c[::-1])
else:
    print("NO")

n,m=map(int, input().split())
i,j=0,0
s=str(m)
s=len(s)
a=[0]
p,q=0,0
g=[]

a[0]=n
for i in range((m//2)*s):
    p=2*a[i]
    q=10*a[i]+1
    a.append(p)
    a.append(q)
    #if 2**(i-1)>(m):
       # break
for i in range(len(a)):
    if a[i]==m:
        j=i
        print('YES')
        while a[j]!=n:
            g.append(a[j])
            j=(j-1)//2
if g==[]:
    print('NO')
else:
    g.reverse()
    print(n,*g)

a,b = map(int,input().split())
steps = [b]
while True:
	if b < a:
		print('NO')
		import sys
		sys.exit(0)
	if b == a:
		break
	if b % 2 == 0:
		b //= 2
		steps.append(b)
		continue
	if b % 10 != 1:
		b = -1
	else:
		b = (b - 1) // 10
		steps.append(b)
print(' '.join(reversed([str(s) for s in steps])))

a,b=map(int,input().split())
l=[b]
while(a<b):
    if b%2:
        if b%2==1:
            b//=10
            l.append(b)
        else:print("NO");exit();
    else:
        b//=2
        l.append(b)
if a==b:print("YES");print(len(l));print(*l[::-1])
else:print("NO")

s = input()
s += " "
k = 0
a = ""
b =""
for i in s:
    if k == 0:
        if i != ' ':
            a += i
        else:
            k += 1
    elif k == 1:
        if i != ' ':
            b += i
a1 = []
b1 = []
a1 += a
b1 += b
a2 = int(a)
b2 = int(b)
y1 = b
y = []
while b2 > a2:
    if (b2 - 1) % 10 == 0:
        b2 = int((b2 - 1) / 10)
        y.append(b2)
    else:
        if b2 % 2 == 0:
            b2 = int(b2 / 2)
            y.append(b2)
        else:
            print("NO")
if b2 == a2:
    print("YES")
    print(len(y) + 1)
    y = y[::-1]
    for i in y:
        print(i, end=" ")
    print(y1)

import sys

a, b = sys.stdin.readline().strip().split()
a, b = int(a), int(b)

mas = []
i=0
while b>=a and i==0:
    mas += [b]
    if b % 2 == 0:
        b=b/2
    elif b%10==1:
        b=(b-1)/10
    else:
        i+=1
mas.reverse()

if a==mas[0] and i==0:
    print "YES"
    print len(mas)
    print " ".join(map(str, mas))
else:
    print "NO"

(a,b) = map(int,raw_input().split())
anmas = [b]

while b>a:
    if b%2==0:
        b/=2
        anmas.append(b)
    elif b%10==1:
        b/=10
        anmas.append(b)
    else:
        print "NO"
        break

if b==a:
    anmas.append(b)
    anmas.reverse()
    print "YES"
    print len(anmas)
    print ' '.join(map(str,anmas))

def recurs(x,path):
    global start
    global c
    if c==1:
        return
    if x<start:
        c=0
        return
    if x==start:
        c=1
        return
    x1=x
    if x%10==1:
        path.append(2)
        recurs(x1//10, path)
    else:
        path.append(1)
        recurs(x//2,path)
start,b=map(int,input().split())
c=0
path=[]
recurs(b,path)
if c==0:
    print('NO')
elif c==1:
    print('YES')
    print(len(path)+1)
    print(start,end=' ')
    for i in range(1,len(path)+1):
        if path[-i]==1:
            start*=2
            print(start,end=' ')
        elif path[-i]==2:
            start=start*10+1
            print(start,end=' ')

import sys
def check(a):
    temp = inp[0]
    for i in a:
        if i=='1': temp*=2
        if i=='2': temp=temp*10+1
    if temp == inp[1]:
        return True
    else:
        return False
def printt(a):
    print('YES')
    print(len(a))
    for i in a:
        print(i,end=' ')
def solve(a):
    if check(a):
        printt(a)
        sys.exit()
    if len(a)>10: return
    solve(a+'1')
    solve(a+'2')
inp = list(map(int,input().split()))
solve('')
print('NO')

'''

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

'''
import sys
s=list(map(int,input().split()))
a=s[0]
b=s[1]
l=[b]
for i in range(100):
    if a==b:
        print("YES")
        print(len(l))
        print(" ".join(str(i) for  i in (l[::-1])))
        break
    if b%2==0:

        b=b//2
        if b%2!=0:

            break
        l.append(b)
    else:
        b=b//10
        if b%2!=0:

            break
        l.append(b)
if(a!=b):

    print("NO")

a,b=input().split()
a=int(a)
b=int(b)
f=0
l=[]
while(b>a):
    if (b%2==1):
        if (b-1)%10==0:
            l.append(b)
            b=(b-1)//10
        else:
            print("NO")
            f=1
            break
    else:
        l.append(b)
        b=b//2
if (f==0):
    if a==b:
        print("YES")
        l.append(a)
        for i in range (len(l)):
              print(l[len(l)-i-1],end=' ')
    else:
        print("NO")

a,b = map(int,input().split())
Flag = True
c = [b]
while a != b and Flag:
    if b % 10 == 1:
        b = b // 10
        c.append(b)
    elif b % 2 == 0 and b != 0:
        b = b // 2
        c.append(b)
    else:
        Flag = False
if Flag:
    print ('Yes')
    print (len(c))
    c = c[::-1]
    for i in c:
        print (i,end=' ')
else:
    print ('No')

a,b = map(int,input().split())
l = [b]
while b % 2 == 0 or b % 10 == 1:
    print("i")
    if b == a:
        print(1)
        break
    elif b % 2 == 0:
        print(2)
        b = int(b/2)
        l.append(b)
    else:
        print(3)
        b = int((b-1)/10)
        l.append(b)

if b == a:
    print("YES")
    print(len(l))
    print(*reversed(l))
else:
    print("NO")

a,b=map(int,input().split())
l=[]
flag=0
while b!=a and b>0:
	if b%2==0:
		l.append(b)
		b//=2
	elif b!=a and len(str(b))==1:
		flag=1
		break
	elif str(b)[-1]=="1":
		l.append(b)
		b=b//10
	else:
		flag=1
		break
if flag==1:
	print("NO")
else:
	l.append(a)
	l.reverse()
	print("YES")
	print(*l)

a, b = map(int, input().split())
order = [b]
while b > a:
    if b % 2 == 0:
        b //= 2
        order.append(b)
    elif b % 10 == 1:
        b //= 10
        order.append(10)
if a == b:
    print("YES")
    print(len(order))
    for i in range(len(order) - 1, -1, -1):
        print(order[i], end=" ")
else:
    print("NO")

def qweqwe(a, b):
    global mas
    if b % 10 in [3,5,7,9] and b > a:
        mas.append("NO")
        return 0
    else:
        if b % 10 == 1 and b > a:
            b = b // 10
            mas.append(b)
            s = qweqwe(a, b)
        else:
            if b > a:
                b = b // 2
                mas.append(b)
                s = qweqwe(a, b)

a = [int(i) for i in input().split()]
mas = [a[1]]
b = qweqwe(a[0], a[1])
if mas[-1] == a[0]:
    print(len(mas))
    for i in range(len(mas) - 1, -1, -1):
        print(mas[i], end = " ")
else:
    print("NO")

a, b = list(map(int, input().split()))
arr = [str(b)]
while b > a:
    if b % 10 == 1:
        b //= 10
        arr.append(str(b))
    elif b % 2 == 0:
        b //= 2
        arr.append(str(b))
    else:
        b = -1
if b == a:
    print('YES', len(arr), ' '.join(arr), sep='\n')
else:
    print('NO')

#coding=utf-8

a,b=map(int,raw_input().split())
outputs=[b]
num=1
while b>a:
	if b%2==0:
		b=b/2
		outputs.append(b)
		num+=1
	else:
		b=(b-1)/10
		outputs.append(b)
		num+=1
if a==b:
	print "YES"
	print num
	for x in outputs[::-1]:
		print x,
else:
	print "NO"

a,b = map(int,input().split())
output = []
num = b
n1,n2=0,0

output.append(num)

while (num!=a):
    if (num<a):
        output.clear()
        print("NO")
        exit()
    elif (num%2==0):
        num/=2
        output.append(int(num))
        n1+=1
    elif (int(num/10)%2==0):
        num=int(num-1)/10
        output.append(int(num))
        n2+=1
    else:
        output.clear()
        print("NO")
        exit()

if (n1==0 or n2==0):
    output.clear()
    print("NO")
    exit()

output.reverse()
print("YES")
print(len(output))
for i in output:
    print(i, end=" ")