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