#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 9e18;
const int inf = 2147483647;
long long phi(long long n) {
  long long ans = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ans = ans / i * (i - 1);
      while (n % i == 0) n /= i;
    }
  }
  if (n > 1) ans = ans / n * (n - 1);
  return ans;
}
long long qpow(long long a, long long b, long long mod) {
  long long r = 1;
  for (; b; b >>= 1) {
    if (b & 1) r = (r * a) % mod;
    a = (a * a) % mod;
  }
  return r;
}
long long C(int n, int m) {
  if (m < n - m) m = n - m;
  long long ans = 1;
  for (int i = m + 1; i <= n; i++) ans *= i;
  for (int i = 1; i <= n - m; i++) ans /= i;
  return ans;
}
const int N = 1e5 + 5;
int a[N], b[N], t[N];
void work() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n; i++) scanf("%d", &b[i]);
  int T = a[1] + b[1], ko = 0;
  for (int t1 = 0; t1 <= 3; t1++) {
    int t2 = T - t1;
    if (t2 < 0) break;
    int ok = 1;
    t[1] = t1, t[2] = t2;
    if ((t[1] | t[2]) != a[1]) continue;
    if ((t[1] & t[2]) != b[1]) continue;
    for (int i = 3; i <= n; i++) {
      t[i] = a[i - 1] + b[i - 1] - t[i - 1];
      if (t[i] < 0 || t[i] > 3) {
        ok = 0;
        break;
      }
      if (a[i - 1] != (t[i] | t[i - 1]) || b[i - 1] != (t[i] & t[i - 1])) {
        ok = 0;
        break;
      }
    }
    if (ok) {
      ko = 1;
      break;
    }
  }
  if (ko) {
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d ", t[i]);
  } else
    puts("NO");
}
int main() {
  work();
  return 0;
}
