#include <bits/stdc++.h>
using namespace std;
int n, a[100001], b[100001];
void solve(int first) {
  vector<int> ans(1, first);
  for (int i = 1; i < n; i++) {
    int pre = ans.back();
    for (int j = 0; j <= 3; j++) {
      if ((pre & j) == b[i] && (pre | j) == a[i]) {
        ans.push_back(j);
        break;
      }
    }
  }
  if (ans.size() != n) return;
  cout << "YES\n";
  for (int x : ans) cout << x << ' ';
  exit(0);
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) cin >> b[i];
  for (int i = 0; i <= 3; i++) solve(i);
  cout << "NO";
  return 0;
}
