#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x;
  cin >> n;
  bool ok = false;
  vector<int> v(0);
  v.clear();
  int a[n - 1], b[n - 1];
  for (i = 0; i < n - 1; ++i) cin >> a[i];
  for (i = 0; i < n - 1; ++i) cin >> b[i];
  v.push_back(0);
  for (i = 0; i < n - 1; ++i) {
    ok = true;
    for (j = 0; j <= 3; ++j) {
      if (((v[i] & j) == b[i]) && ((v[i] | j) == a[i])) {
        v.push_back(j);
        break;
      }
    }
    if (v.size() - 1 == i) {
      ok = false;
      v.clear();
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
    for (i = 0; i < n; ++i) cout << v[i] << " ";
    return 0;
  }
  v.push_back(1);
  for (i = 0; i < n - 1; ++i) {
    ok = true;
    for (j = 0; j <= 3; ++j) {
      if (((v[i] & j) == b[i]) && ((v[i] | j) == a[i])) {
        v.push_back(j);
        break;
      }
    }
    if (v.size() - 1 == i) {
      v.clear();
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
    for (i = 0; i < n; ++i) cout << v[i] << " ";
    return 0;
  }
  v.push_back(2);
  for (i = 0; i < n - 1; ++i) {
    ok = true;
    for (j = 0; j <= 3; ++j) {
      if (((v[i] & j) == b[i]) && ((v[i] | j) == a[i])) {
        v.push_back(j);
        break;
      }
    }
    if (v.size() - 1 == i) {
      v.clear();
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
    for (i = 0; i < n; ++i) cout << v[i] << " ";
    return 0;
  }
  v.push_back(3);
  for (i = 0; i < n - 1; ++i) {
    ok = true;
    for (j = 0; j <= 3; ++j) {
      if (((v[i] & j) == b[i]) && ((v[i] | j) == a[i])) {
        v.push_back(j);
        break;
      }
    }
    if (v.size() - 1 == i) {
      v.clear();
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
    for (i = 0; i < n; ++i) cout << v[i] << " ";
    return 0;
  }
  if (!ok) cout << "NO";
  return 0;
}
