#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int INF = INT_MAX;
const long long INFLL = (long long)1e18;
const double PI = acos(-1.0);
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const int N = (int)1e5 + 5;
const int P = 1 << 18;
int B[4][4], A[4][4];
int n;
int a[N], b[N];
int t[N];
vector<int> v[N];
int main() {
  ios::sync_with_stdio(false);
  cout.setf(ios::fixed | ios::showpoint);
  cout.precision(8);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      A[i][j] = i | j;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      B[i][j] = i & j;
    }
  }
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n - 1; i++) {
    bool flag = false;
    for (int k = 0; k < 4; k++) {
      for (int l = k; l < 4; l++) {
        if (a[i] == A[k][l] && b[i] == B[k][l]) {
          flag = true;
          v[i].push_back(k);
          v[i].push_back(l);
        }
      }
    }
    if (!flag) {
      return !printf("NO\n");
    }
  }
  bool ok = false;
  for (int x = 0; x < (int)v[0].size(); x++) {
    int cur;
    if (x % 2 == 0)
      cur = v[0][x + 1];
    else
      cur = v[0][x - 1];
    t[0] = v[0][x];
    int cnt = 1;
    for (int i = 1; i < n - 1; i++) {
      bool flag = false;
      int pos = -1;
      for (int j = 0; j < (int)v[i].size(); j++) {
        int can = v[i][j];
        if (can == cur) {
          flag = true;
          pos = j;
          break;
        }
      }
      if (flag) {
        cnt++;
        t[i] = cur;
        if (pos % 2 == 0)
          cur = v[i][pos + 1];
        else
          cur = v[i][pos - 1];
      }
    }
    if (cnt == n - 1) {
      ok = true;
      t[n - 1] = cur;
      break;
    }
  }
  if (!ok) return !printf("NO\n");
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << t[i] << ' ';
  }
  cout << '\n';
  return 0;
}
