#include <bits/stdc++.h>
using namespace std;
void usefiles(const string &s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
template <class t1, class t2>
inline bool cmin(t1 &a, const t2 &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class t1, class t2>
inline bool cmax(t1 &a, const t2 &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void run();
signed main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  run();
}
long long mex(vector<long long> v) {
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  for (long long i = 0; i < ((long long)v.size()); ++i)
    if (i != v[i]) return i;
  return ((long long)v.size());
}
void run() {
  long long n;
  cin >> n;
  vector<long long> a(n - 1), b(n - 1);
  for (auto &x : a) cin >> x;
  for (auto &x : b) cin >> x;
  vector<vector<long long>> dp(n, vector<long long>(4, 0));
  for (long long i = 0; i < 4; ++i) dp[0][i] = 1;
  vector<vector<long long>> prv(n, vector<long long>(4, -1));
  for (long long i = 1; i < n; ++i) {
    for (long long j = 0; j < 4; ++j)
      for (long long k = 0; k < 4; ++k)
        if ((j | k) == a[i - 1] && (j & k) == b[i - 1] &&
            cmax(dp[i][j], dp[i - 1][k]))
          prv[i][j] = k;
  }
  for (long long i = 0; i < 4; ++i)
    if (dp.back()[i]) {
      cout << "YES" << endl;
      long long cur = i;
      vector<long long> res;
      for (long long j = n - 1; j > -1; --j) {
        res.push_back(cur);
        cur = prv[j][cur];
      }
      reverse(res.begin(), res.end());
      for (auto &x : res) cout << x << " ";
      cout << endl;
      return;
    }
  cout << "NO" << endl;
}
