Problem: Let's call a graph with n vertices, each of which has it's own point A_i = (x_i, y_i) with integer coordinates, a planar tree if:

  * All points A_1, A_2, …, A_n are different and no three points lie on the same line. 
  * The graph is a tree, i.e. there are exactly n-1 edges there exists a path between any pair of vertices. 
  * For all pairs of edges (s_1, f_1) and (s_2, f_2), such that s_1 ≠ s_2, s_1 ≠ f_2, f_1 ≠ s_2, and f_1 ≠ f_2, the segments A_{s_1} A_{f_1} and A_{s_2} A_{f_2} don't intersect. 



Imagine a planar tree with n vertices. Consider the convex hull of points A_1, A_2, …, A_n. Let's call this tree a spiderweb tree if for all 1 ≤ i ≤ n the following statements are true:

  * All leaves (vertices with degree ≤ 1) of the tree lie on the border of the convex hull. 
  * All vertices on the border of the convex hull are leaves. 



An example of a spiderweb tree: 

<image>

The points A_3, A_6, A_7, A_4 lie on the convex hull and the leaf vertices of the tree are 3, 6, 7, 4.

Refer to the notes for more examples.

Let's call the subset S ⊂ \{1, 2, …, n\} of vertices a subtree of the tree if for all pairs of vertices in S, there exists a path that contains only vertices from S. Note that any subtree of the planar tree is a planar tree.

You are given a planar tree with n vertexes. Let's call a partition of the set \{1, 2, …, n\} into non-empty subsets A_1, A_2, …, A_k (i.e. A_i ∩ A_j = ∅ for all 1 ≤ i < j ≤ k and A_1 ∪ A_2 ∪ … ∪ A_k = \{1, 2, …, n\}) good if for all 1 ≤ i ≤ k, the subtree A_i is a spiderweb tree. Two partitions are different if there exists some set that lies in one parition, but not the other.

Find the number of good partitions. Since this number can be very large, find it modulo 998 244 353.

Input

The first line contains an integer n (1 ≤ n ≤ 100) — the number of vertices in the tree.

The next n lines each contain two integers x_i, y_i (-10^9 ≤ x_i, y_i ≤ 10^9) — the coordinates of i-th vertex, A_i.

The next n-1 lines contain two integers s, f (1 ≤ s, f ≤ n) — the edges (s, f) of the tree.

It is guaranteed that all given points are different and that no three of them lie at the same line. Additionally, it is guaranteed that the given edges and coordinates of the points describe a planar tree.

Output

Print one integer — the number of good partitions of vertices of the given planar tree, modulo 998 244 353.

Examples

Input


4
0 0
0 1
-1 -1
1 -1
1 2
1 3
1 4


Output


5


Input


5
3 2
0 -3
-5 -3
5 -5
4 5
4 2
4 1
5 2
2 3


Output


8


Input


6
4 -5
0 1
-2 8
3 -10
0 -1
-4 -5
2 5
3 2
1 2
4 6
4 2


Output


13


Input


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


Output


36

Note

<image> The picture for the first sample.

In the first test case, all good partitions are:

  1. \{1\}, \{2\}, \{3\}, \{4\}; 
  2. \{1, 2\}, \{3\}, \{4\}; 
  3. \{1, 3\}, \{2\}, \{4\}; 
  4. \{1, 4\}, \{2\}, \{3\}; 
  5. \{1, 2, 3, 4\}. 



The partition \{1, 2, 3\}, \{4\} isn't good, because the subtree \{1, 2, 3\} isn't spiderweb tree, since the non-leaf vertex 1 lies on the convex hull.

The partition \{2, 3, 4\}, \{1\} isn't good, because the subset \{2, 3, 4\} isn't a subtree.

<image> The picture for the second sample.

In the second test case, the given tree isn't a spiderweb tree, because the leaf vertex 1 doesn't lie on the convex hull. However, the subtree \{2, 3, 4, 5\} is a spiderweb tree.

<image> The picture for the third sample. <image> The picture for the fourth sample.

In the fourth test case, the partition \{1, 2, 3, 4\}, \{5, 6, 7, 8\} is good because all subsets are spiderweb subtrees.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 105, P = 998244353;
using pii = pair<int, int>;
using ll = long long;
ll f[N], dp[N], dp2[N << 1], val[N][N];
vector<int> v[N], w[N][N], d[N];
pii a[N];
int n, rt, e[N][N], fs[N][N], lst[N][N], clr[N][N];
void dfsw(int pos, int fa) {
  w[rt][pos] = w[rt][fa];
  w[rt][pos].push_back(pos);
  for (auto &i : v[pos])
    if (i != fa) dfsw(i, pos);
}
inline ll cs(pii a, pii b) {
  return a.first * 1ll * b.second - a.second * 1ll * b.first;
}
bool half(pii x) { return x.second < 0 || (x.second == 0 && x.first < 0); }
pii operator-(const pii &a, const pii &b) {
  return {a.first - b.first, a.second - b.second};
}
bool chk(pii x, pii y) {
  pii aa = a[x.second] - a[x.first], bb = a[y.second] - a[y.first];
  int xx = half(aa), yy = half(bb);
  return xx == yy ? cs(aa, bb) > 0 : xx < yy;
}
void dfs(int pos, int fa) {
  for (auto it = v[pos].begin(); it != v[pos].end(); it++)
    if (*it == fa) {
      v[pos].erase(it);
      break;
    }
  d[pos].push_back(pos);
  for (auto &i : v[pos]) {
    dfs(i, pos);
    for (auto &j : d[i]) d[pos].push_back(j);
  }
  f[pos] = 1;
  for (auto &i : v[pos]) f[pos] = f[pos] * dp[i] % P;
  dp[pos] = f[pos];
  for (auto &i : v[pos]) {
    ll tt = f[i];
    for (auto &j : v[pos])
      if (i != j) tt = tt * dp[j] % P;
    dp[pos] = (dp[pos] + tt) % P;
  }
  int kk = 0;
  memset(e, 0, sizeof(e));
  for (auto &i : d[pos])
    for (auto &j : v[i]) e[i][j] = ++kk, e[j][i] = ++kk;
  vector<pii> al;
  sort(d[pos].begin(), d[pos].end(), [](int x, int y) {
    return a[x].second == a[y].second ? a[x].first < a[y].first
                                      : a[x].second < a[y].second;
  });
  int m = d[pos].size();
  for (auto &i : d[pos])
    for (auto &j : d[pos])
      if (w[i][j].size() >= 3 && cs(a[j] - a[i], a[pos] - a[i]) >= 0) {
        al.push_back({i, j});
        int sz = w[i][j].size();
        fs[i][j] = e[w[i][j][0]][w[i][j][1]];
        lst[i][j] = e[w[i][j][sz - 1]][w[i][j][sz - 2]];
        clr[i][j] = 0;
        val[i][j] = 1;
        for (int k = 0; k < sz; k++) {
          int x = k ? w[i][j][k - 1] : -1,
              y = k <= sz - 2 ? w[i][j][k + 1] : -1, dq = w[i][j][k];
          for (auto &s : v[dq]) {
            if (s == x || s == y) continue;
            if (x < 0) {
              if (cs(a[y] - a[dq], a[s] - a[dq]) > 0) continue;
            } else if (y < 0) {
              if (cs(a[s] - a[x], a[dq] - a[x]) < 0) continue;
            } else {
              int aa = cs(a[y] - a[dq], a[s] - a[dq]) > 0,
                  bb = cs(a[s] - a[x], a[dq] - a[x]) < 0;
              if (cs(a[dq] - a[x], a[y] - a[x]) > 0) {
                if (aa && bb) continue;
              } else if (aa || bb)
                continue;
            }
            val[i][j] = val[i][j] * dp[s] % P;
          }
          clr[i][j] |= dq == pos;
        }
      }
  sort(al.begin(), al.end(), chk);
  for (int i = 0; i < m; i++)
    for (int j = i + 1; j < m; j++)
      if (e[d[pos][i]][d[pos][j]])
        for (int ban = -1; ban <= 1; ban += 2) {
          memset(dp2, 0, sizeof(dp2));
          dp2[e[d[pos][i]][d[pos][j]]] = 1;
          for (auto &s : al) {
            if (ban == -1 && clr[s.first][s.second]) continue;
            int ss = fs[s.first][s.second], tt = lst[s.first][s.second];
            dp2[tt] = (dp2[tt] + dp2[ss] * val[s.first][s.second]) % P;
          }
          dp2[e[d[pos][i]][d[pos][j]]] += P - 1;
          dp[pos] += ban * dp2[e[d[pos][i]][d[pos][j]]];
        }
  dp[pos] = (dp[pos] % P + P) % P;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 1; i < n; i++) {
    int t1, t2;
    cin >> t1 >> t2;
    v[t1].push_back(t2);
    v[t2].push_back(t1);
  }
  for (int i = 1; i <= n; i++) {
    rt = i;
    dfsw(i, 0);
    for (int j = 1; j <= n; j++) {
      for (auto &k : w[i][j])
        if (cs(a[j] - a[i], a[k] - a[i]) < 0) {
          w[i][j].clear();
          break;
        }
    }
  }
  dfs(1, 0);
  cout << dp[1] << endl;
  return 0;
}