import os

import sys



if os.getenv("LOCAL"):

    sys.stdin = open("_in.txt", "r")



sys.setrecursionlimit(10 ** 9)

INF = float("inf")

IINF = 10 ** 18

MOD = 10 ** 9 + 7

# MOD = 998244353





N, A, B = list(map(int, sys.stdin.buffer.readline().split()))





# 解説

# 違うbitの数が奇数なら戻ってこれる





def bitcount(n):

    ret = 0

    while n > 0:

        ret += n & 1

        n >>= 1

    return ret





# vs = []

# for i in range(1 << N):

#     for j in range(i, 1 << N):

#         if bitcount(i ^ j) == 1:

#             vs.append((i, j))

# plot_graph(vs)





# @lru_cache(maxsize=None)

# @debug

def solve(n, a, b):

    if n <= 0:

        return []

    if bitcount(a ^ b) % 2 == 0:

        return []

    if n == 1:

        return [a, b]

    # 奇数

    # 違うbitを1つ取り除く

    mask = 1

    while (a ^ b) & mask == 0:

        mask <<= 1

    na = a // (mask << 1) * mask + a % mask

    nb = b // (mask << 1) * mask + b % mask

    mid = na ^ 1

    ret = []

    for r in solve(n - 1, na, mid):

        ret.append((r // mask * mask << 1) + (a & mask) + r % mask)

    for r in solve(n - 1, mid, nb):

        ret.append((r // mask * mask << 1) + (b & mask) + r % mask)

    return ret





ans = solve(N, A, B)

if ans:

    print('YES')

    print((*ans))

else:

    print('NO')



# for A in range(1 << N):

#     for B in range(1 << N):

#         ans = solve(N, A, B)

#         if ans:

#             assert ans[0] == A

#             assert ans[-1] == B

#             for a, b in zip(ans, ans[1:]):

#                 assert bitcount(a ^ b) == 1

#                 assert a < (1 << N)

import os

import sys



if os.getenv("LOCAL"):

    sys.stdin = open("_in.txt", "r")



sys.setrecursionlimit(10 ** 9)

INF = float("inf")

IINF = 10 ** 18

MOD = 10 ** 9 + 7

# MOD = 998244353





N, A, B = list(map(int, sys.stdin.buffer.readline().split()))





# 解説

# 違うbitの数が奇数なら戻ってこれる





def bitcount(n):

    ret = 0

    while n > 0:

        ret += n & 1

        n >>= 1

    return ret





# vs = []

# for i in range(1 << N):

#     for j in range(i, 1 << N):

#         if bitcount(i ^ j) == 1:

#             vs.append((i, j))

# plot_graph(vs)





# @lru_cache(maxsize=None)

# @debug

def solve(n, a, b):

    if n <= 0:

        return []

    if bitcount(a ^ b) % 2 == 0:

        return []

    if n == 1:

        return [a, b]

    # 奇数

    # 違うbitを1つ取り除く

    mask = 1

    while (a ^ b) & mask == 0:

        mask <<= 1

    r_mask = mask - 1

    l_mask = ~mask - r_mask

    na = ((a & l_mask) >> 1) + (a & r_mask)

    nb = ((b & l_mask) >> 1) + (b & r_mask)

    mid = na ^ 1

    ret = []

    for r in solve(n - 1, na, mid):

        ret.append(((r << 1) & l_mask) + (a & mask) + (r & r_mask))

    for r in solve(n - 1, mid, nb):

        ret.append(((r << 1) & l_mask) + (b & mask) + (r & r_mask))

    return ret





ans = solve(N, A, B)

if ans:

    print('YES')

    print((*ans))

else:

    print('NO')



# for A in range(1 << N):

#     for B in range(1 << N):

#         ans = solve(N, A, B)

#         if ans:

#             assert ans[0] == A

#             assert ans[-1] == B

#             for a, b in zip(ans, ans[1:]):

#                 assert bitcount(a ^ b) == 1

#                 assert a < (1 << N)

import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(10**9)
INF = float("inf")
IINF = 10**18
MOD = 10**9 + 7
# MOD = 998244353
N, A, B = list(map(int, sys.stdin.buffer.readline().split()))
# 解説
# 違うbitの数が奇数なら戻ってこれる
def bitcount(n):
    ret = 0
    while n > 0:
        ret += n & 1
        n >>= 1
    return ret


# vs = []
# for i in range(1 << N):
#     for j in range(i, 1 << N):
#         if bitcount(i ^ j) == 1:
#             vs.append((i, j))
# plot_graph(vs)
# @lru_cache(maxsize=None)
# @debug
def solve(n, a, b):
    if n <= 0:
        return []
    if bitcount(a ^ b) % 2 == 0:
        return []
    if n == 1:
        return [a, b]
    # 奇数
    # 違うbitを1つ取り除く
    mask = 1
    while (a ^ b) & mask == 0:
        mask <<= 1
    na = a // (mask << 1) * mask + a % mask
    nb = b // (mask << 1) * mask + b % mask
    mid = na ^ 1
    ret = []
    for r in solve(n - 1, na, mid):
        ret.append((r // mask * mask << 1) + (a & mask) + r % mask)
    for r in solve(n - 1, mid, nb):
        ret.append((r // mask * mask << 1) + (b & mask) + r % mask)
    return ret


ans = solve(N, A, B)
if ans:
    print("YES")
    print((*ans))
else:
    print("NO")
# for A in range(1 << N):
#     for B in range(1 << N):
#         ans = solve(N, A, B)
#         if ans:
#             assert ans[0] == A
#             assert ans[-1] == B
#             for a, b in zip(ans, ans[1:]):
#                 assert bitcount(a ^ b) == 1
#                 assert a < (1 << N)

import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(10**9)
INF = float("inf")
IINF = 10**18
MOD = 10**9 + 7
# MOD = 998244353
N, A, B = list(map(int, sys.stdin.buffer.readline().split()))
# 解説
# 違うbitの数が奇数なら戻ってこれる
def bitcount(n):
    ret = 0
    while n > 0:
        ret += n & 1
        n >>= 1
    return ret


# vs = []
# for i in range(1 << N):
#     for j in range(i, 1 << N):
#         if bitcount(i ^ j) == 1:
#             vs.append((i, j))
# plot_graph(vs)
# @lru_cache(maxsize=None)
# @debug
def solve(n, a, b):
    if n <= 0:
        return []
    if bitcount(a ^ b) % 2 == 0:
        return []
    if n == 1:
        return [a, b]
    # 奇数
    # 違うbitを1つ取り除く
    mask = 1
    while (a ^ b) & mask == 0:
        mask <<= 1
    r_mask = mask - 1
    l_mask = ~mask - r_mask
    na = ((a & l_mask) >> 1) + (a & r_mask)
    nb = ((b & l_mask) >> 1) + (b & r_mask)
    mid = na ^ 1
    ret = []
    for r in solve(n - 1, na, mid):
        ret.append(((r << 1) & l_mask) + (a & mask) + (r & r_mask))
    for r in solve(n - 1, mid, nb):
        ret.append(((r << 1) & l_mask) + (b & mask) + (r & r_mask))
    return ret


ans = solve(N, A, B)
if ans:
    print("YES")
    print((*ans))
else:
    print("NO")
# for A in range(1 << N):
#     for B in range(1 << N):
#         ans = solve(N, A, B)
#         if ans:
#             assert ans[0] == A
#             assert ans[-1] == B
#             for a, b in zip(ans, ans[1:]):
#                 assert bitcount(a ^ b) == 1
#                 assert a < (1 << N)

-    na = a // (mask << 1) * mask + a % mask -    nb = b // (mask << 1) * mask + b % mask +    r_mask = mask - 1 +    l_mask = ~mask - r_mask +    na = ((a & l_mask) >> 1) + (a & r_mask) +    nb = ((b & l_mask) >> 1) + (b & r_mask) -        ret.append((r // mask * mask << 1) + (a & mask) + r % mask) +        ret.append(((r << 1) & l_mask) + (a & mask) + (r & r_mask)) -        ret.append((r // mask * mask << 1) + (b & mask) + r % mask) +        ret.append(((r << 1) & l_mask) + (b & mask) + (r & r_mask))