#include <bits/stdc++.h>
using namespace std;
std::vector<long long int> tt;
void solve() {
  long long int n, m, x, y, i, j, k, ans = 0, c = 0, sum = 0;
  cin >> n;
  std::vector<long long int> a(n - 1);
  std::vector<long long int> b(n - 1);
  for (i = 0; i < n - 1; i++) cin >> a[i];
  for (i = 0; i < n - 1; i++) cin >> b[i];
  for (i = 0; i < 4; i++) {
    tt = {i};
    for (j = 0; j < n - 1; j++) {
      for (k = 0; k < 4; k++) {
        long long int temp = tt[tt.size() - 1];
        if ((temp | k) == a[j] && (temp & k) == b[j]) {
          tt.push_back(k);
          break;
        }
      }
    }
    if (tt.size() == n) break;
  }
  if (tt.size() == n) {
    cout << "YES\n";
    for (auto x : tt) cout << x << " ";
    cout << "\n";
  } else
    cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
