#include <bits/stdc++.h>
using namespace std;
vector<int> solve(vector<int> &a, vector<int> &b, int n) {
  vector<vector<int>> d(n + 1, vector<int>(2, 0)), p(n + 1, vector<int>(2, -1));
  vector<int> out;
  d[0][0] = d[0][1] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++)
        if (d[i - 1][j] == 1 && (j | k) == a[i - 1] && b[i - 1] == (j & k)) {
          d[i][k] = 1;
          p[i][k] = j;
        }
  }
  int y = 0;
  if (!d[n][y] && !d[n][y + 1])
    return out;
  else if (d[n][y + 1])
    y++;
  for (int i = n; i >= 0; i--) {
    out.emplace_back(y);
    y = p[i][y];
  }
  reverse(out.begin(), out.end());
  return out;
}
int main() {
  int n;
  cin >> n;
  n--;
  vector<int> a1(n), a2(n), b1(n), b2(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a1[i] = ((x & 2) >> 1);
    a2[i] = (x & 1);
  }
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    b1[i] = ((x & 2) >> 1);
    b2[i] = (x & 1);
  }
  vector<int> OTBET1 = solve(a1, b1, n), OTBET2 = solve(a2, b2, n);
  if (OTBET1.size() != n + 1 || OTBET2.size() != n + 1)
    return cout << "NO\n", 0;
  cout << "YES\n";
  for (int i = 0; i <= n; i++) {
    cout << OTBET1[i] * 2 + OTBET2[i] << ' ';
  }
  return 0;
}
