import sys from random import randint input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) N, Q = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) def simulate(x, i): if i == Q: return [x] ok = [] if x < N and x + 1 != a[i] and x + 1 != b[i]: r = simulate(x + 1, i + 1) if r != None: r.append(x) return r if x > 1 and x - 1 != a[i] and x - 1 != b[i]: l = simulate(x - 1, i + 1) if l != None: l.append(x) return l return None if N <= 100000: for x in range(1, N + 1): res = simulate(x, 0) if res != None: print("YES") res.reverse() for r in res: print(r) exit(0) print("NO") else: while True: res = simulate(randint(1, N), 0) if res != None: print("YES") res.reverse() for r in res: print(r) exit(0)