#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int A[maxn], B[maxn];
int solved[maxn];
int n;
bool solve(int x, int y) {
  solved[x] = y;
  if (x == n - 1) return true;
  for (int i = 0; i <= 3; ++i) {
    solved[x + 1] = i;
    int a = solved[x] | solved[x + 1];
    int b = solved[x] & solved[x + 1];
    if (a != A[x] || b != B[x]) continue;
    if (solve(x + 1, i)) return true;
  }
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) scanf("%d", &A[i]);
  for (int i = 0; i < n - 1; ++i) scanf("%d", &B[i]);
  for (int a = 0; a <= 3; ++a) {
    if (solve(0, a)) {
      printf("YES\n");
      for (int i = 0; i < n; ++i) printf("%d ", solved[i]);
      printf("\n");
      for (int i = 0; i < n - 1; ++i) {
        assert(A[i] == (solved[i] | solved[i + 1]));
        assert(B[i] == (solved[i] & solved[i + 1]));
      }
      return 0;
    }
  }
  printf("NO\n");
}
