#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], b[N];
int t[N];
int n;
int flag;
void dfs(int now) {
  if (flag == 1) return;
  if (now == n + 1) {
    flag = 1;
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", t[i]);
    return;
  }
  for (int i = 0; i <= 3; i++) {
    if ((i | t[now - 1]) == a[now - 1] && (i & t[now - 1]) == b[now - 1]) {
      t[now] = i;
      dfs(now + 1);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n - 1; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] < b[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  int tot = 0;
  for (int i = 0; i <= 3; i++) {
    t[1] = i;
    dfs(2);
  }
  if (flag == 0) printf("NO");
  return 0;
}
