#include <bits/stdc++.h>
using namespace std;
int n;
int an[100005], bn[100005];
int a[100005];
bool prime = false;
bool solve(int x) {
  a[n - 1] = x;
  for (int i = n - 2; i >= 0; i--) {
    bool flag = false;
    for (int j = 0; j <= 3; j++) {
      int ans = a[i + 1] | j;
      int cnt = a[i + 1] & j;
      if (ans == an[i] && cnt == bn[i]) {
        a[i] = j;
        flag = true;
        break;
      }
    }
    if (!flag) {
      return false;
    }
  }
  return true;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> an[i];
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> bn[i];
  }
  if (solve(0) || solve(1) || solve(2) || solve(3)) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
