#include <bits/stdc++.h>
using namespace std;
const long long inf = LONG_MAX;
const long long arr = 1000000;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main(void) {
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> b(n);
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) cin >> b[i];
  vector<long long> ans(arr, 0);
  for (int h = 0; h <= 3; h++) {
    ans[0] = h;
    long long id = 1;
    for (int i = 1; i < n; i++) {
      bool first = false;
      for (int j = 3; j >= 0; j--) {
        if (((j | ans[i - 1]) == a[i - 1]) && ((j & ans[i - 1]) == b[i - 1])) {
          ans[i] = j;
          first = true;
          id++;
          break;
        }
      }
      if (!first) break;
    }
    if (id == n) {
      cout << "YES" << '\n';
      for (int i = 0; i < n; i++) cout << ans[i] << " ";
      cout << '\n';
      return 0;
    }
  }
  cout << "NO" << '\n';
  return 0;
}
