#include <bits/stdc++.h>
using namespace std;
void show(vector<int> v) {
  cout << "YES" << endl;
  int i, j, len = v.size();
  for (i = 0; i < len; i++) {
    cout << v[i] << ' ';
  }
}
int main() {
  int n, a[200001], b[200001], i, j, k, l;
  vector<int> v;
  cin >> n;
  for (i = 0; i < n - 1; i++) cin >> a[i];
  for (i = 0; i < n - 1; i++) cin >> b[i];
  int okk = 0;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      v.push_back(i);
      v.push_back(j);
      if ((i | j) != a[0] || (i & j) != b[0]) {
        v.clear();
        continue;
      }
      int vec = 1;
      for (k = 1; k < n - 1; k++) {
        bool ok = 0;
        for (l = 0; l < 4; l++) {
          if ((v[vec] & l) == b[k] && (v[vec] | l) == a[k]) {
            ok = 1;
            v.push_back(l);
            vec++;
            break;
          }
        }
        if (!ok) break;
      }
      if (vec == n - 1) {
        show(v);
        return 0;
      }
      v.clear();
    }
  }
  cout << "NO" << endl;
}
