#include <bits/stdc++.h>
using namespace std;
void Debug() { cout << '\n'; }
template <class FIRST, class... REST>
void Debug(FIRST arg, REST... rest) {
  cout << arg << " ";
  Debug(rest...);
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  if (!v.empty()) {
    for (int i = int(0); i < int((int)(v).size() - 1); i++) out << v[i] << ", ";
    out << v.back();
  }
  out << "]";
  return out;
}
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& v) {
  out << "(" << v.first << ", " << v.second << ")";
  return out;
}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const long long mod = 1000000007;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
const double PI = 3.14159265358979323846;
int N;
int A[MAX_N], B[MAX_N];
int ans[MAX_N];
void solve() {
  cin >> N;
  for (int i = int(0); i < int(N - 1); i++) cin >> A[i];
  for (int i = int(0); i < int(N - 1); i++) cin >> B[i];
  for (int q = int(0); q < int(4); q++) {
    ans[0] = q;
    bool ok = true;
    for (int i = int(0); i < int(N - 1); i++) {
      bool found = false;
      for (int j = int(0); j < int(4); j++) {
        if ((ans[i] | j) == A[i] && (ans[i] & j) == B[i]) {
          found = true;
          ans[i + 1] = j;
          break;
        }
      }
      if (!found) {
        ok = false;
        break;
      }
    }
    if (ok) {
      cout << "YES\n";
      for (int i = int(0); i < int(N); i++) {
        cout << ans[i] << " ";
      }
      cout << "\n";
      return;
    }
  }
  cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed;
  cout.precision(20);
  srand((unsigned int)time(NULL));
  solve();
  return 0;
}
