#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long n;
long long c = 0;
std::vector<long long> ans;
std::vector<long long> v, a, b;
bool flag = false;
struct node {
  long long a, b, c, d;
  bool flag;
};
long long Power(long long x, long long y) {
  long long temp;
  if (y == 0) return 1;
  temp = Power(x, y / 2) % MOD;
  if (y % 2 == 0)
    return ((temp % MOD) * (temp % MOD)) % MOD;
  else
    return ((x % MOD) * (temp % MOD) * (temp % MOD)) % MOD;
}
void find(long long x) {
  if (c == n - 1) {
    ans = v;
    flag = true;
    return;
  }
  for (long long i = 0; i <= 3; i++) {
    if (a[c] == (x | i) && b[c] == (x & i)) {
      c++;
      v.push_back(i);
      find(i);
      c--;
      v.pop_back();
    }
  }
}
int solve() {
  cin >> n;
  a.resize(n - 1);
  b.resize(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 <= 3; i++) {
    for (long long j = 0; j <= 3; j++) {
      c = 1;
      flag = false;
      if (a[0] == (i | j) && b[0] == (i & j)) {
        v.push_back(i);
        v.push_back(j);
        find(j);
        v.pop_back();
        v.pop_back();
        if (flag) {
          cout << "YES" << endl;
          for (long long k = 0; k < n; k++) cout << ans[k] << " ";
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
