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;
bool try_solve(int rb, int rt, vector<vector<int> > &Gb,
               vector<vector<int> > &Gt, vector<int> &match) {
  int N = Gb.size();
  for (int i = 0; i < N; i++) match[i] = -1;
  match[rb] = rt;
  vector<int> freev, part(N, -1);
  part[rt] = rt;
  for (int i = 0; i < N; i++)
    if (match[i] == -1) freev.push_back(i);
  vector<bool> block(N, false);
  queue<int> q;
  q.push(rb);
  for (int i = 0; i < N; i++) {
    if (q.empty()) return false;
    int v = q.front(), w = match[q.front()];
    for (auto it = Gb[v].begin(); it != Gb[v].end(); it++) block[*it] = true;
    for (auto it = Gt[w].begin(); it != Gt[w].end(); it++)
      if (part[*it] == -1) {
        part[*it] = v;
        int u = -1;
        for (int j = 0; j < 3 + (int)Gb[v].size(); j++) {
          int x = rand() % freev.size();
          if (block[freev[x]]) continue;
          u = freev[x];
          swap(freev[x], freev.back());
          freev.pop_back();
          break;
        }
        if (u == -1) return false;
        match[u] = *it;
        q.push(u);
      }
    for (auto it = Gb[v].begin(); it != Gb[v].end(); it++) block[*it] = false;
    q.pop();
  }
  return true;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<vector<int> > G[2];
  vector<int> deg[2];
  int R[2];
  for (int i = 0; i < 2; i++) {
    G[i].resize(N);
    deg[i].resize(N, 0);
    for (int j = 0; j < N - 1; j++) {
      int u, v;
      cin >> u >> v;
      if (i) u -= N, v -= N;
      G[i][--u].push_back(--v);
      G[i][v].push_back(u);
      deg[i][u]++, deg[i][v]++;
    }
    R[i] = 0;
    for (int j = 0; j < N; j++)
      if (deg[i][j] > deg[i][R[i]]) R[i] = j;
  }
  int REP = 100;
  srand(23479 + N);
  for (int rep = 0; rep < REP; rep++) {
    int t = rand() % 2;
    vector<int> vr;
    for (int i = 0; i < N; i++)
      if (N - 1 - deg[1 - t][i] >= deg[t][R[t]]) vr.push_back(i);
    if (vr.empty()) continue;
    int r = vr[rand() % vr.size()];
    vector<int> match[2];
    for (int i = 0; i < 2; i++) match[i] = vector<int>(N);
    bool ok = try_solve(R[t], r, G[t], G[1 - t], match[t]);
    if (ok) {
      cout << "Yes\n";
      for (int i = 0; i < N; i++) match[1 - t][match[t][i]] = i;
      for (int i = 0; i < N; i++)
        cout << N + 1 + match[0][i] << ((i == N - 1) ? "\n" : " ");
      return 0;
    }
    ok = try_solve(r, R[t], G[1 - t], G[t], match[1 - t]);
    if (ok) {
      cout << "Yes\n";
      for (int i = 0; i < N; i++) match[t][match[1 - t][i]] = i;
      for (int i = 0; i < N; i++)
        cout << N + 1 + match[0][i] << ((i == N - 1) ? "\n" : " ");
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}