#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
vector<int> ans;
vector<vector<pair<int, int>>> pr;
bool dfs(int stolb, int row, bool second_cell) {
  if (pr[stolb].size() == 0) return false;
  int value;
  if (second_cell) {
    value = pr[stolb][row].second;
  } else {
    value = pr[stolb][row].first;
  }
  if (stolb == pr.size() - 1) {
    ans.push_back(value);
    return true;
  }
  for (int i = 0; i < pr[stolb + 1].size(); i++) {
    if (pr[stolb + 1][i].first == value) {
      if (dfs(stolb + 1, i, true)) {
        ans.push_back(value);
        return true;
      }
    }
    if (pr[stolb + 1][i].second == value) {
      if (dfs(stolb + 1, i, false)) {
        ans.push_back(value);
        return true;
      }
    }
  }
  return false;
}
int solve(istream& cin, ostream& cout) {
  int n;
  cin >> n;
  n--;
  vector<int> ra(n), rb(n);
  for (int& i : ra) {
    cin >> i;
  }
  for (int& i : rb) {
    cin >> i;
  }
  pr.resize(n);
  for (int i = 0; i < n; i++) {
    for (int a = 0; a < 4; a++) {
      for (int b = 0; b < 4; b++) {
        if ((a | b) == ra[i] && (a & b) == rb[i]) {
          pr[i].push_back({a, b});
        }
      }
    }
  }
  for (int i = 0; i < pr[0].size(); i++) {
    if (dfs(0, i, 0)) {
      cout << "YES\n";
      cout << pr[0][i].second << ' ';
      for (auto it = ans.rbegin(); it != ans.rend(); it++) {
        cout << *it << " ";
      }
      return 0;
    }
    if (dfs(0, i, 1)) {
      cout << "YES\n";
      cout << pr[0][i].first << ' ';
      for (auto it = ans.rbegin(); it != ans.rend(); it++) {
        cout << *it << " ";
      }
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
void test() {
  vector<pair<string, string>> tests = {};
  for (auto [in, out] : tests) {
    stringstream input(in);
    stringstream output;
    solve(input, output);
    if (output.str() != out) {
      cout << "test failed. Input:\n " << in << "\nRight answer:\n"
           << out << "\nasnwer:\n"
           << output.str() << endl;
      exit(1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve(cin, cout);
  return 0;
}
