#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
char a1[N], a2[N], b1[N], b2[N], t1[N], t2[N];
int main() {
  int n;
  int a;
  char hasSoultuion = true;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a;
    a1[i] = a & 1, a2[i] = (a >> 1) & 1;
  }
  for (int i = 0; i < n; ++i) t1[i] = t2[i] = 2;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a;
    b1[i] = a & 1, b2[i] = (a >> 1) & 1;
    if (a1[i] == 0 && b1[i] == 1) {
      hasSoultuion = false;
      break;
    }
    if (a1[i] == 0 && b1[i] == 0)
      t1[i] = t1[i + 1] = 0;
    else if (a1[i] == 1 && b1[i] == 1)
      t1[i] = t1[i + 1] = 1;
    if (a2[i] == 0 && b2[i] == 1) {
      hasSoultuion = false;
      break;
    }
    if (a2[i] == 0 && b2[i] == 0)
      t2[i] = t2[i + 1] = 0;
    else if (a2[i] == 1 && b2[i] == 1)
      t2[i] = t2[i + 1] = 1;
  }
  for (int i = 0; i < n - 1; ++i) {
    if (t1[i] != 2 && t1[i + 1] == 2) t1[i + 1] = 1 ^ t1[i];
    if (t2[i] != 2 && t2[i + 1] == 2) t2[i + 1] = 1 ^ t2[i];
  }
  for (int i = n - 1; i >= 1; --i) {
    if (t1[i] != 2 && t1[i - 1] == 2) t1[i - 1] = 1 ^ t1[i];
    if (t2[i] != 2 && t2[i - 1] == 2) t2[i - 1] = 1 ^ t2[i];
  }
  char l1 = 1, l2 = 1;
  for (int i = 0; i < n; ++i) {
    if (t1[i] == 2) t1[i] = l1;
    l1 ^= 1;
    if (t2[i] == 2) t2[i] = l2;
    l2 ^= 1;
  }
  for (int i = 0; i < n - 1; ++i) {
    if (((t1[i] | t1[i + 1]) == a1[i]) && ((t2[i] | t2[i + 1]) == a2[i]) &&
        ((t1[i] & t1[i + 1]) == b1[i]) && ((t2[i] & t2[i + 1]) == b2[i])) {
    } else {
    }
  }
  if (hasSoultuion) {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      cout << (int)t1[i] + (int)t2[i] * 2 << " ";
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
