#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005], flg;
int main() {
  int n;
  cin >> n;
  int ans[n];
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) cin >> b[i];
  for (int i = 0; i < 4; i++) {
    ans[0] = i;
    flg = 1;
    for (int j = 1; j < n; j++) {
      ans[j] = a[j - 1] + b[j - 1] - ans[j - 1];
      if (((ans[j] | ans[j - 1]) != a[j - 1]) ||
          ((ans[j] & ans[j - 1]) != b[j - 1])) {
        flg = 0;
        break;
      }
    }
    if (flg) break;
  }
  if (!flg) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
