#include <bits/stdc++.h>
using namespace std;
int a[(int)3e5];
int b[(int)3e5];
int t[(int)3e5];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    cin >> b[i];
  }
  for (int q = 0; q <= 3; q++) {
    t[1] = q;
    bool f = 1;
    for (int i = 1; i < n; i++) {
      bool e = 0;
      for (int x1 = 0; x1 <= 3; x1++) {
        if ((x1 & t[i]) == b[i] && ((x1 | t[i]) == a[i])) {
          e = 1;
          t[i + 1] = x1;
        }
      }
      if (e == 0) f = 0;
    }
    if (f) {
      cout << "YES" << endl;
      for (int i = 1; i <= n; i++) cout << t[i] << ' ';
      return 0;
    }
  }
  cout << "NO";
}
