#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
int main() {
  int n;
  scanf("%d", &n);
  int a[N], b[N], t[N];
  for (int i = 0; i < n - 1; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n - 1; i++) scanf("%d", &b[i]);
  for (int i = 0; i < 4; ++i) {
    memset(t, -1, sizeof(t));
    t[n - 1] = i;
    for (int j = n - 2; j >= 0; --j) {
      for (int k = 0; k < 4; ++k) {
        if ((k | t[j + 1]) == a[j] && (k & t[j + 1]) == b[j]) {
          t[j] = k;
          break;
        }
      }
      if (t[j] == -1) break;
    }
    if (t[0] != -1) {
      printf("YES\n");
      for (int i = 0; i < n - 1; ++i) {
        printf("%d ", t[i]);
      }
      printf("%d\n", t[n - 1]);
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
