#include <bits/stdc++.h>
using namespace std;
const long long int M = 1000000007;
const int N = 2001;
const int INF = 1 << 20;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n - 1), b(n - 1), c(n, -1);
  for (int i = 0; i < n - 1; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) cin >> b[i];
  vector<vector<bool> > possible(n, vector<bool>(4));
  possible[0] = {1, 1, 1, 1};
  for (int i = 0; i < a.size(); ++i) {
    for (int j = 0; j < possible[i].size(); ++j) {
      if (!possible[i][j]) continue;
      for (int k = 0; k < possible[i + 1].size(); ++k) {
        if ((j & k) == b[i] && (j | k) == a[i]) possible[i + 1][k] = 1;
      }
    }
  }
  for (int i = 0; i < 4; ++i) {
    if (possible[n - 1][i]) {
      c[n - 1] = i;
    }
  }
  if (c[n - 1] == -1) {
    cout << "NO";
    return 0;
  }
  for (int i = n - 2; i >= 0; --i) {
    for (int j = 0; j < 4; ++j) {
      if (possible[i][j] && (j | c[i + 1]) == a[i] && (j & c[i + 1]) == b[i])
        c[i] = j;
    }
  }
  cout << "YES" << endl;
  for (auto v : c) cout << v << ' ';
  return 0;
}
