#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > ans;
vector<int> a;
vector<int> b;
int n;
bool tr = 0;
vector<int> res;
int check(int a_0, int a_1) {
  res[0] = a_0;
  res[1] = a_1;
  if ((a_0 | a_1) != a[0] || (a_0 & a_1) != b[0]) {
    return 0;
  }
  for (int i = 1; i < n - 1; ++i) {
    if (a[i] == 3 && b[i] == 0) {
      if (res[i] == 0) {
        res[i + 1] = 3;
        continue;
      }
      if (res[i] == 3) {
        res[i + 1] = 0;
        continue;
      }
      if (res[i] == 1) {
        res[i + 1] = 2;
        continue;
      }
      if (res[i] == 2) {
        res[i + 1] = 1;
        continue;
      }
    }
    if ((a[i] | b[i]) == a[i] && (a[i] & b[i]) == b[i]) {
      if (a[i] == res[i]) {
        res[i + 1] = b[i];
        continue;
      }
      if (b[i] == res[i]) {
        res[i + 1] = a[i];
        continue;
      }
      if (a[i] != res[i] && b[i] != res[i]) {
        return 0;
      }
    } else {
      return 0;
    }
  }
  return 1;
}
int main() {
  cin >> n;
  a.resize(n - 1);
  b.resize(n - 1);
  for (int i = 0; i < int(n - 1); i++) {
    cin >> a[i];
  }
  for (int i = 0; i < int(n - 1); i++) {
    cin >> b[i];
  }
  res.resize(n);
  if (a[0] == 3 && b[0] == 0) {
    for (int j = 0; j < int(4); j++) {
      if (check(j, 3 - j)) {
        cout << "YES" << endl;
        for (int i = 0; i < int(n); i++) {
          cout << res[i] << " ";
        }
        return 0;
      }
    }
    cout << "NO" << endl;
    return 0;
  } else {
    if (check(a[0], b[0])) {
      cout << "YES" << endl;
      for (int i = 0; i < int(n); i++) {
        cout << res[i] << " ";
      }
      return 0;
    }
    if (check(b[0], a[0])) {
      cout << "YES" << endl;
      for (int i = 0; i < int(n); i++) {
        cout << res[i] << " ";
      }
      return 0;
    }
    cout << "NO" << endl;
    return 0;
  }
  return 0;
}
