#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << "\n";
  err(++it, args...);
}
const long long MOD = 1e9 + 7, N = 1e2 + 5, inf = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  {
    int n;
    cin >> n;
    n--;
    int a[n], b[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    ;
    for (int i = 0; i < n; i++) cin >> b[i];
    ;
    bool flg = false;
    for (int i = 0; i < 4; i++) {
      vector<int> v;
      bool red = true;
      v.push_back(i);
      for (int j = 0; j < n; j++) {
        int cnt = 0;
        for (int k = 0; k < 4; k++) {
          if ((v[j] | k) == a[j] and (v[j] & k) == b[j]) {
            v.push_back(k);
            cnt++;
            break;
          }
        }
        if (cnt == 0) {
          red = false;
          break;
        }
      }
      if (red) {
        cout << "YES"
             << "\n";
        for (auto x : v) cout << x << " ";
        flg = true;
        break;
      }
    }
    if (!flg)
      cout << "NO"
           << "\n";
  }
}
