#include <bits/stdc++.h>
using namespace std;
int a[100000];
int b[100000];
int m[100000];
int n;
void rec(int i) {
  if (i == n - 1) {
    cout << "YES" << endl;
    for (int k = 0; k < n; ++k) cout << m[k] << ' ';
    exit(0);
  }
  for (int j = 0; j < 4; ++j) {
    if (((m[i] | j) == a[i]) && ((m[i] & j) == b[i])) {
      m[i + 1] = j;
      rec(i + 1);
    }
  }
}
int main() {
  cin >> 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) {
    m[0] = i;
    rec(0);
  }
  cout << "NO";
  return 0;
}
