#include <bits/stdc++.h>
using namespace std;
long long a[110000], b[110000], dp[110000][5];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, i, j, k;
  vector<long long> v;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> a[i];
  }
  for (i = 1; i < n; i++) {
    cin >> b[i];
  }
  for (i = 2; i <= n; i++) {
    for (j = 0; j < 4; j++) {
      dp[i][j] = -1;
      for (k = 0; k <= 3; k++) {
        if (dp[i - 1][k] != -1) {
          if (((j & k) == b[i - 1]) && ((j | k) == a[i - 1])) dp[i][j] = k;
        }
      }
    }
  }
  long long fl = 0;
  for (i = 0; i < 4; i++) {
    if (dp[n][i] != -1) {
      cout << "YES\n";
      for (j = n; j > 0; j--) {
        v.push_back(i);
        i = dp[j][i];
      }
      fl = 1;
      break;
    }
  }
  if (fl == 0)
    cout << "NO";
  else {
    for (i = 0; i < v.size(); i++) cout << v[v.size() - i - 1] << " ";
  }
  return 0;
}
