#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LONGINF = 9223372036854775807;
const long long MOD = 1e9 + 7;
vector<int> a, b, t;
void solve() {
  int n;
  cin >> n;
  a.resize(n - 1);
  for (int i = 0; i < n - 1; ++i) cin >> a[i];
  b.resize(n - 1);
  for (int i = 0; i < n - 1; ++i) cin >> b[i];
  t.resize(n);
  for (int j = 0; j < 4; ++j) {
    t[0] = j;
    bool flag = true;
    for (int i = 1; i < n; ++i) {
      int nt = -1;
      for (int k = 0; k < 4; ++k) {
        if ((t[i - 1] | k) == a[i - 1] && (t[i - 1] & k) == b[i - 1]) {
          nt = k;
          break;
        }
      }
      if (nt == -1) {
        flag = false;
        break;
      } else
        t[i] = nt;
    }
    if (flag) {
      cout << "YES\n";
      for (auto& i : t) cout << i << ' ';
      return;
    }
  }
  cout << "NO\n";
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  std::ios_base::sync_with_stdio(0);
  bool mult = false;
  if (mult) {
    int t;
    cin >> t;
    while (t--) solve();
  } else
    solve();
  return 0;
}
