#include <bits/stdc++.h>
using namespace std;
vector<long long> a, b;
vector<long long> t;
long long n;
void rec(long long i) {
  if (i == n) {
    cout << "YES" << endl;
    for (auto &i : t) {
      cout << i << " ";
    }
    exit(0);
  }
  if (i == 0) {
    for (long long m = 0; m < 4; ++m) {
      t.push_back(m);
      rec(i + 1);
      t.pop_back();
    }
    return;
  }
  for (long long m = 0; m < 4; ++m) {
    if (a[i - 1] == (t[i - 1] | m) && b[i - 1] == (t[i - 1] & m)) {
      t.push_back(m);
      rec(i + 1);
      t.pop_back();
    }
  }
}
signed main() {
  cin >> n;
  a.resize(n - 1);
  b.resize(n - 1);
  for (auto &i : a) {
    cin >> i;
  }
  for (auto &i : b) {
    cin >> i;
  }
  rec(0);
  cout << "NO" << endl;
  return 0;
}
