#include <bits/stdc++.h>
using namespace std;
bool F = false;
bool next_elem(int num, int el, const vector<int>& a, const vector<int>& b,
               const vector<int>& t) {
  if (num == 0) {
    return true;
  }
  if ((a[num - 1] == (t[num - 1] | el)) && (b[num - 1] == (t[num - 1] & el))) {
    return true;
  }
  return false;
}
void next(int n, vector<int>& t, const vector<int>& a, const vector<int>& b,
          vector<int>& ans) {
  if (t.size() == n) {
    F = true;
    ans = t;
  } else {
    int x = t.size();
    for (int j = 0; j <= 3; ++j) {
      if (next_elem(x, j, a, b, t)) {
        t.push_back(j);
        next(n, t, a, b, ans);
        t.pop_back();
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n - 1);
  vector<int> b(n - 1);
  vector<int> t;
  vector<int> ans;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    cin >> b[i];
  }
  next(n, t, a, b, ans);
  if (F == false) {
    cout << "NO";
  } else {
    cout << "YES\n";
    for (int i = 0; i < n; ++i) {
      cout << ans[i] << " ";
    }
  }
  return 0;
}
