#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, N = 1e5 + 10;
int n, a[N], b[N], t[N];
inline void read(int &x) {
  x = 0;
  char c = getchar(), f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
bool check(int x, int i) {
  t[i] = x;
  if (i == n) return 1;
  for (int num = 0; num <= 3; ++num) {
    if ((num | x) == a[i] && (num & x) == b[i]) return check(num, i + 1);
  }
  return 0;
}
int main() {
  read(n);
  for (int i = 1; i <= n - 1; ++i) read(a[i]);
  for (int i = 1; i <= n - 1; ++i) read(b[i]);
  for (int num = 0; num <= 3; ++num) {
    if (check(num, 1)) {
      puts("YES");
      for (int i = 1; i <= n; ++i) printf("%d ", t[i]);
      return 0;
    }
  }
  puts("NO");
  return 0;
}
