def split(n, a, b, used, ai, ans, width):

    # print(n, a, b, used, ai, ans, width)

    # print(*(f'{c:5d}' for c in ans))

    # print(*(f'{c:05b}' for c in ans))

    if width == 2:

        ans[ai] = a

        ans[ai + 1] = b

        return

    x = a ^ b

    y = x & -x  # Rightmost Bit where is different a and b

    l = y.bit_length() - 1

    used.append(l)

    i = 0

    for i in range(n):

        if i not in used:

            break

    la, lb = a, a ^ (1 << i)

    ra, rb = lb ^ y, b

    width >>= 1

    split(n, la, lb, used, ai, ans, width)

    split(n, ra, rb, used, ai + width, ans, width)

    used.pop()





def solve(n, a, b):

    if bin(a).count('1') % 2 == bin(b).count('1') % 2:

        print('NO')

        return

    used = []

    ans = [0] * (1 << n)

    split(n, a, b, used, 0, ans, 1 << n)

    print('YES')

    print((*ans))





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

solve(n, a, b)

def split(n, a, b, remain, ai, ans, width):

    # print(n, a, b, remain, ai, ans, width)

    # print(*(f'{c:5d}' for c in ans))

    # print(*(f'{c:05b}' for c in ans))

    if width == 2:

        ans[ai] = a

        ans[ai + 1] = b

        return

    x = a ^ b

    y = x & -x  # Rightmost Bit at which is different for a and b

    l = y.bit_length() - 1

    remain.remove(l)

    i = next(iter(remain))

    lb = a ^ (1 << i)

    ra = lb ^ y

    width >>= 1

    split(n, a, a ^ (1 << i), remain, ai, ans, width)

    split(n, ra, b, remain, ai + width, ans, width)

    remain.add(l)





def solve(n, a, b):

    if bin(a).count('1') % 2 == bin(b).count('1') % 2:

        print('NO')

        return

    remain = set(range(n))

    ans = [0] * (1 << n)

    split(n, a, b, remain, 0, ans, 1 << n)

    print('YES')

    print((*ans))





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

solve(n, a, b)

def split(n, a, b, used, ai, ans, width):
    # print(n, a, b, used, ai, ans, width)
    # print(*(f'{c:5d}' for c in ans))
    # print(*(f'{c:05b}' for c in ans))
    if width == 2:
        ans[ai] = a
        ans[ai + 1] = b
        return
    x = a ^ b
    y = x & -x  # Rightmost Bit where is different a and b
    l = y.bit_length() - 1
    used.append(l)
    i = 0
    for i in range(n):
        if i not in used:
            break
    la, lb = a, a ^ (1 << i)
    ra, rb = lb ^ y, b
    width >>= 1
    split(n, la, lb, used, ai, ans, width)
    split(n, ra, rb, used, ai + width, ans, width)
    used.pop()


def solve(n, a, b):
    if bin(a).count("1") % 2 == bin(b).count("1") % 2:
        print("NO")
        return
    used = []
    ans = [0] * (1 << n)
    split(n, a, b, used, 0, ans, 1 << n)
    print("YES")
    print((*ans))


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

def split(n, a, b, remain, ai, ans, width):
    # print(n, a, b, remain, ai, ans, width)
    # print(*(f'{c:5d}' for c in ans))
    # print(*(f'{c:05b}' for c in ans))
    if width == 2:
        ans[ai] = a
        ans[ai + 1] = b
        return
    x = a ^ b
    y = x & -x  # Rightmost Bit at which is different for a and b
    l = y.bit_length() - 1
    remain.remove(l)
    i = next(iter(remain))
    lb = a ^ (1 << i)
    ra = lb ^ y
    width >>= 1
    split(n, a, a ^ (1 << i), remain, ai, ans, width)
    split(n, ra, b, remain, ai + width, ans, width)
    remain.add(l)


def solve(n, a, b):
    if bin(a).count("1") % 2 == bin(b).count("1") % 2:
        print("NO")
        return
    remain = set(range(n))
    ans = [0] * (1 << n)
    split(n, a, b, remain, 0, ans, 1 << n)
    print("YES")
    print((*ans))


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

-def split(n, a, b, used, ai, ans, width): -    # print(n, a, b, used, ai, ans, width) +def split(n, a, b, remain, ai, ans, width): +    # print(n, a, b, remain, ai, ans, width) -    y = x & -x  # Rightmost Bit where is different a and b +    y = x & -x  # Rightmost Bit at which is different for a and b -    used.append(l) -    i = 0 -    for i in range(n): -        if i not in used: -            break -    la, lb = a, a ^ (1 << i) -    ra, rb = lb ^ y, b +    remain.remove(l) +    i = next(iter(remain)) +    lb = a ^ (1 << i) +    ra = lb ^ y -    split(n, la, lb, used, ai, ans, width) -    split(n, ra, rb, used, ai + width, ans, width) -    used.pop() +    split(n, a, a ^ (1 << i), remain, ai, ans, width) +    split(n, ra, b, remain, ai + width, ans, width) +    remain.add(l) -    used = [] +    remain = set(range(n)) -    split(n, a, b, used, 0, ans, 1 << n) +    split(n, a, b, remain, 0, ans, 1 << n)