#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const double pi = acos(-1);
const double eps = 1e-6;
const long long mod = 1e9 + 7;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int a[100005], b[100005];
vector<int> v[20];
int f = 0;
int n;
int dfs(int x, int in) {
  if (in == n) {
    f = 1;
    printf("YES\n");
    for (auto xx : v[x]) printf("%d ", xx);
    return 0;
  }
  for (int i = 0; i <= 3; i++) {
    if ((v[x][in - 1] | i) == a[in] && (v[x][in - 1] & i) == b[in]) {
      v[x].push_back(i);
      dfs(x, in + 1);
      v[x].pop_back();
    }
  }
}
int main() {
  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 k = 0;
  for (int i = 0; i <= 3; i++) {
    for (int j = 0; j <= 3; j++) {
      if (((i | j) == a[1]) && ((i & j) == b[1])) {
        v[k].push_back(i);
        v[k].push_back(j);
        k++;
      }
    }
  }
  for (int i = 0; i < k; i++) {
    f = 0;
    dfs(i, 2);
    if (f == 1) {
      return 0;
    }
  }
  printf("NO\n");
}
