#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
inline void print(vector<int> vec) {
  for (int i = 0; i < vec.size(); ++i) {
    printf("%d ", vec[i]);
  }
  printf("\n");
}
int A[100005], B[100005];
int num[100005], n;
inline void dfs(int pos) {
  if (pos == n - 1) {
    printf("YES\n");
    for (int i = 0; i < n; ++i) {
      printf("%d ", num[i]);
    }
    exit(0);
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (((i | j) == A[pos]) && ((i & j) == B[pos]) &&
          (pos == 0 || i == num[pos])) {
        if (pos == 0) {
          num[pos] = i;
        }
        num[pos + 1] = j;
        dfs(pos + 1);
        num[pos + 1] = 0;
      }
    }
  }
}
int main(int argc, const char* argv[]) {
  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]);
  }
  dfs(0);
  printf("NO");
  ;
  ;
}
