#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n - 1);
  vector<int> b(n - 1);
  for (auto &d : a) cin >> d;
  for (auto &d : b) cin >> d;
  for (int u = 0; u <= 3; ++u) {
    vector<int> ans;
    ans.push_back(u);
    bool flagg = true;
    for (int i = 0; i < n - 1; ++i) {
      bool flag = false;
      int t = -1;
      for (int j = 0; j <= 3; ++j) {
        if (((j & *ans.rbegin()) == b[i]) && ((j | *ans.rbegin()) == a[i])) {
          flag = true;
          t = j;
          break;
        }
      }
      if (!flag) {
        flagg = false;
        break;
      }
      ans.push_back(t);
    }
    if (flagg) {
      cout << "YES" << endl;
      for (auto s : ans) cout << s << " ";
      return 0;
    }
  }
  cout << "NO";
}
