#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
long long N;
long long A[MAXN], B[MAXN], T[MAXN];
int solve(int i) {
  if (i == N) return 1;
  for (int t = (0); t < int(4); t++) {
    if (i == 0 or
        ((A[i - 1] == (T[i - 1] | t)) and (B[i - 1] == (T[i - 1] & t))))
      T[i] = t;
    if (T[i] != -1 and solve(i + 1) == 1) return 1;
  }
  return -1;
}
int main() {
  cin >> N;
  for (int i = (0); i < int(N - 1); i++) cin >> A[i];
  for (int i = (0); i < int(N - 1); i++) cin >> B[i];
  memset(T, -1, sizeof(T));
  int ans = solve(0);
  if (ans == 1) {
    cout << "YES\n";
    for (int i = (0); i < int(N); i++) cout << T[i] << ' ';
    cout << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
