Problem: There are N cities in Bob's country connected by roads. Some pairs of cities are connected by public transport. There are two competing transport companies — Boblines operating buses and Bobrail running trains. When traveling from A to B, a passenger always first selects the mode of transport (either bus or train), and then embarks on a journey. For every pair of cities, there are exactly two ways of how to travel between them without visiting any city more than once — one using only bus routes, and the second using only train routes. Furthermore, there is no pair of cities that is directly connected by both a bus route and a train route.

You obtained the plans of each of the networks. Unfortunately, each of the companies uses different names for the same cities. More precisely, the bus company numbers the cities using integers from 1 to N, while the train company uses integers between N + 1 and 2N. Find one possible mapping between those two numbering schemes, such that no pair of cities is connected directly by both a bus route and a train route. Note that this mapping has to map different cities to different cities.

Input

The first line contains an integer N (2 ≤ N ≤ 10000), the number of cities.

N - 1 lines follow, representing the network plan of Boblines. Each contains two integers u and v (1 ≤ u, v ≤ N), meaning that there is a bus route between cities u and v.

N - 1 lines follow, representing the network plan of Bobrail. Each contains two integers u and v (N + 1 ≤ u, v ≤ 2N), meaning that there is a train route between cities u and v.

Output

If there is no solution, output a single line with the word "No".

If a solution exists, output two lines. On the first line, there should be the word "Yes". On the second line, there should be N integers P1, P2, ..., PN (N + 1 ≤ Pi ≤ 2N) — the mapping between the two numbering schemes. More precisely, for i ≠ j it should be Pi ≠ Pj, and for every direct bus route (i, j), there is no direct train route between (Pi, Pj).

If there are multiple solutions, you may print any of them.

Examples

Input

4
1 2
2 3
3 4
5 6
6 7
7 8


Output

Yes
6 8 5 7


Input

4
1 2
2 3
3 4
5 6
5 7
5 8


Output

No


Input

7
1 2
1 3
1 4
1 5
5 6
6 7
8 9
9 10
10 11
11 12
12 13
13 14


Output

Yes
9 14 11 12 13 10 8

Note

The first sample (bus lines in red and rail lines in blue):

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 11000;
vector<int> adj[2 * N];
int chk[2 * N], ans[N], p[2 * N], deg[2 * N], x[10], y[10];
int check_star(vector<int> &A, int *x) {
  int flg = 0;
  int n = A.size();
  for (int u : A) {
    if (deg[u] == n - 2) {
      x[0] = u;
      flg = 1;
      for (int v : A) {
        if (v == u) continue;
        if (deg[v] == 2) {
          x[1] = v;
          for (int w : adj[v]) {
            if (w == u) continue;
            x[2] = w;
            break;
          }
          break;
        }
      }
      break;
    }
  }
  return flg;
}
void solve_star(vector<int> &B, int *y) {
  for (int u : B) {
    if (deg[u] == 1) {
      y[0] = u;
      int w = adj[u][0];
      y[2] = w;
      for (int v : B) chk[v] = (v == w);
      for (int v : adj[w]) chk[v] = 1;
      for (int v : B) {
        if (!chk[v]) {
          y[1] = v;
          break;
        }
      }
      return;
    }
  }
}
void solve_path(vector<int> &A, int *x) {
  for (int u : A) {
    if (deg[u] == 1) {
      x[0] = u;
      break;
    }
  }
  for (int i = 1; i < A.size(); i++) {
    int u = x[i - 1];
    for (int v : adj[u]) {
      if (i >= 2 && v == x[i - 2]) continue;
      x[i] = v;
      break;
    }
  }
}
void find_leaf(vector<int> &A, int *x) {
  x[0] = 0;
  for (int u : A) {
    if (deg[u] == 1) {
      p[u] = adj[u][0];
      if (!x[0] || deg[p[x[0]]] < deg[p[u]]) x[0] = u;
    }
  }
  for (int u : A) {
    if (deg[u] == 1) {
      if (p[u] != p[x[0]]) {
        x[1] = u;
        return;
      }
    }
  }
}
void solve(vector<int> &A, vector<int> &B) {
  int flg = 0;
  if (check_star(A, x))
    solve_star(B, y), flg = 1;
  else if (check_star(B, y))
    solve_star(A, x), flg = 1;
  if (flg) {
    for (int i = 0; i < 3; i++) ans[x[i]] = y[i];
    for (int i = 0; i < 3; i++) {
      A.erase(lower_bound(A.begin(), A.end(), x[i]));
      B.erase(lower_bound(B.begin(), B.end(), y[i]));
    }
    for (int i = 0; i < A.size(); i++) ans[A[i]] = B[i];
    return;
  }
  int n = A.size();
  if (n < 6) {
    solve_path(A, x);
    solve_path(B, y);
    for (int i = 0; i < n / 2; i++) ans[x[i]] = y[2 * i + 1];
    for (int i = n / 2; i < n; i++) ans[x[i]] = y[2 * (i - n / 2)];
    return;
  }
  find_leaf(A, x);
  find_leaf(B, y);
  int _x[2], _y[2];
  for (int i = 0; i < 2; i++) {
    _x[i] = x[i], _y[i] = y[i];
    A.erase(lower_bound(A.begin(), A.end(), x[i]));
    B.erase(lower_bound(B.begin(), B.end(), y[i]));
    adj[x[i]].clear();
    deg[x[i]] = 0;
    adj[p[x[i]]].erase(find(adj[p[x[i]]].begin(), adj[p[x[i]]].end(), x[i]));
    deg[p[x[i]]]--;
    adj[y[i]].clear();
    deg[y[i]] = 0;
    adj[p[y[i]]].erase(find(adj[p[y[i]]].begin(), adj[p[y[i]]].end(), y[i]));
    deg[p[y[i]]]--;
  }
  solve(A, B);
  for (int i = 0; i < 2; i++) {
    int u = _x[i], v = _y[i];
    if (ans[p[u]] == p[v]) {
      for (int j = 0; j < 2; j++) ans[_x[j]] = _y[j ^ 1];
      return;
    }
    ans[u] = v;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < 2 * n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
    deg[u]++, deg[v]++;
  }
  for (int i = 1; i <= n; i++)
    if (deg[i] == n - 1 || deg[n + i] == n - 1) return puts("No"), 0;
  vector<int> A, B;
  for (int i = 1; i <= n; i++) A.push_back(i), B.push_back(n + i);
  solve(A, B);
  puts("Yes");
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}