#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
const long long int MAXN = (long long int)1e6 + 20;
const long long int N = (long long int)1e5 + 10;
const long long int MOD = (long long int)1e9 + 7;
long long int n;
vector<long long int> a, b, t;
bool poss = false;
void rec(long long int id) {
  if (id == n) {
    cout << "YES\n";
    for (auto &x : t) cout << x << " ";
    cout << '\n';
    poss = true;
    return;
  } else {
    for (long long int i = 0; i < 4; ++i) {
      if (((i | t[id - 1]) == a[id - 1]) and ((i & t[id - 1]) == b[id - 1])) {
        t[id] = i;
        rec(id + 1);
      }
    }
  }
}
void solve() {
  cin >> n;
  a.resize(n - 1);
  b.resize(n - 1);
  for (auto &x : a) cin >> x;
  for (auto &x : b) cin >> x;
  t.resize(n, -1);
  for (long long int i = 0; i < 4; ++i) {
    t[0] = i;
    rec(1);
    if (poss) break;
  }
  if (!poss) cout << "NO\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
