#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 179;
const int MAX = 4;
int ans[N][2];
vector<int> a, b;
signed main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  a.resize(n);
  b.resize(n);
  for (int i = 1; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) cin >> b[i];
  for (int t0 = 0; t0 < 4; t0++) {
    ans[0][0] = t0 % 2;
    ans[0][1] = t0 / 2;
    bool ok = 1;
    for (int i = 1; i < n; i++) {
      int a0 = a[i] % 2;
      int b0 = b[i] % 2;
      int s0 = -1;
      if (a0 == 0) {
        if (ans[i - 1][0] != 0) ok = 0;
        s0 = 0;
      } else {
        if (ans[i - 1][0] == 0) s0 = 1;
      }
      if (b0 == 1) {
        if (ans[i - 1][0] != 1) ok = 0;
        if (s0 == 0) ok = 0;
        s0 = 1;
      } else {
        if (ans[i - 1][0] == 1) {
          if (s0 == 1) ok = 0;
          s0 = 0;
        }
      }
      assert(s0 != -1);
      ans[i][0] = s0;
      a0 = a[i] / 2;
      b0 = b[i] / 2;
      s0 = -1;
      if (a0 == 0) {
        if (ans[i - 1][1] != 0) ok = 0;
        s0 = 0;
      } else {
        if (ans[i - 1][1] == 0) s0 = 1;
      }
      if (b0 == 1) {
        if (ans[i - 1][1] != 1) ok = 0;
        if (s0 == 0) ok = 0;
        s0 = 1;
      } else {
        if (ans[i - 1][1] == 1) {
          if (s0 == 1) ok = 0;
          s0 = 0;
        }
      }
      assert(s0 != -1);
      ans[i][1] = s0;
    }
    if (ok) {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        cout << ans[i][0] + ans[i][1] * 2 << " ";
      }
      cout << endl;
      for (int i = 1; i < n; i++) {
        int t1 = ans[i][0] + ans[i][1] * 2;
        int t2 = ans[i - 1][0] + ans[i - 1][1] * 2;
        if ((t1 | t2) != a[i]) ok = 0;
        if ((t1 & t2) != b[i]) ok = 0;
      }
      assert(ok);
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
