#include <bits/stdc++.h>
using namespace std;
int andd[4][4];
int orr[4][4];
int n;
const int maxn = 1e5 + 7;
int a[maxn];
int b[maxn];
int t[maxn];
void solve(int i) {
  if (i == n + 1) {
    cout << "YES" << endl;
    for (int j = 1; j <= n; j++) {
      cout << t[j] << " ";
    }
    exit(0);
  }
  for (int j = 0; j <= 3; j++) {
    if (((t[i - 1] & j) == b[i - 1]) && ((t[i - 1] | j) == a[i - 1]))
      t[i] = j, solve(i + 1);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) cin >> a[i];
  for (int j = 1; j < n; j++) cin >> b[j];
  for (int i = 0; i <= 3; i++) t[1] = i, solve(2);
  cout << "NO" << endl;
  return 0;
}
