#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long T;
  T = 1;
  while (T--) {
    long long n;
    cin >> n;
    long long a[n], b[n], ans[n];
    for (long long i = 1; i < n; i++) cin >> a[i];
    for (long long i = 1; i < n; i++) cin >> b[i];
    long long k = 0, found;
    while (k <= 3) {
      ans[0] = k++;
      found = 0;
      for (long long i = 1; i < n; i++) {
        found = 0;
        for (long long x = 0; x < 4; x++) {
          long long orr = ans[i - 1] | x;
          long long andd = ans[i - 1] & x;
          if (a[i] == orr && b[i] == andd) {
            ans[i] = x;
            found = 1;
            break;
          }
        }
        if (found == 0) break;
      }
      if (found == 1) break;
    }
    if (found == 0) {
      cout << "NO";
    } else {
      cout << "YES\n";
      for (long long i = 0; i < n; i++) cout << ans[i] << " ";
    }
  }
  return 0;
}
