#include <bits/stdc++.h>
using namespace std;
vector<int> a;
vector<int> b;
vector<int> t;
int n, x;
bool f, g;
bool solve() {
  for (int i = 1; i < n; i++) {
    g = false;
    for (int j = 0; j <= 3; j++) {
      if ((a[i] == (t[i - 1] | j)) && (b[i] == (t[i - 1] & j))) {
        t.push_back(j);
        g = true;
        break;
      }
    }
    if (!g) return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << t[i] << " ";
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  a.push_back(-1);
  b.push_back(-1);
  t.push_back(-1);
  for (int i = 1; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 1; i < n; i++) {
    cin >> x;
    b.push_back(x);
  }
  for (int k = 0; k <= 3; k++) {
    f = true;
    t.clear();
    t.push_back(k);
    if (solve()) return 0;
  }
  cout << "NO";
}
