#include <bits/stdc++.h>
using namespace std;
vector<long long> ans;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n - 1), b(n - 1);
  for (long long i = 0; i < n - 1; i++) cin >> a[i];
  for (long long i = 0; i < n - 1; i++) cin >> b[i];
  for (long long i = 0; i < 4; i++) {
    ans = {i};
    for (long long j = 0; j < n - 1; j++) {
      for (long long x = 0; x < 4; x++) {
        long long last = ans[ans.size() - 1];
        long long a1 = last | x, a2 = last & x;
        if ((a1 == a[j]) && (a2 == b[j])) {
          ans.push_back(x);
          break;
        }
      }
    }
    if (ans.size() == n) break;
  }
  if (ans.size() == n) {
    cout << "YES\n";
    for (long long i : ans) cout << i << " ";
  } else
    cout << "NO";
  return 0;
}
