#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  vector<long long> O(n), A(n);
  for (long long i = 0; i < n - 1; i++) cin >> O[i];
  for (long long i = 0; i < n - 1; i++) cin >> A[i];
  for (long long i = 0; i <= 3; i++) {
    vector<long long> res;
    long long ok = 1;
    res.push_back(i);
    for (long long j = 0; j < n - 1; j++) {
      long long fnd = -1;
      for (long long k = 0; k <= 3; k++) {
        long long o = (res[j] | k);
        long long a = (res[j] & k);
        if (o == O[j] && a == A[j]) {
          fnd = k;
          break;
        }
      }
      if (fnd == -1) {
        ok = 0;
        break;
      }
      res.push_back(fnd);
    }
    if (ok) {
      cout << "YES\n";
      for (auto i : res) {
        cout << i << ' ';
      }
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
