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 MAXN = 103;
const int mod = 998244353;
long long call(pair<int, int> a, pair<int, int> b) {
  return ((long long)a.first * (long long)a.second +
          (long long)b.first * (long long)b.second);
}
long long mul(pair<int, int> a, pair<int, int> b) {
  return ((long long)a.first * (long long)b.second -
          (long long)b.first * (long long)a.second);
}
int check(pair<int, int> a) {
  if (a.second > 0 or (a.second == 0 and a.first > 0)) return 0;
  return 1;
}
int check(pair<int, int> a, pair<int, int> b) {
  long long pr = mul(a, b);
  if (pr != 0) return (pr <= 0);
  return (call(a, b) < 0);
}
int n, x[MAXN], y[MAXN], dp[MAXN], val[MAXN][MAXN], ml[MAXN], e[MAXN][MAXN],
    first[MAXN][MAXN], last[MAXN][MAXN], sum[MAXN << 1], ok[MAXN][MAXN];
vector<int> g[MAXN];
vector<int> way[MAXN][MAXN];
pair<int, int> vect(int i, int j) {
  return (make_pair(x[j] - x[i], y[j] - y[i]));
}
pair<int, int> vect(pair<int, int> it) {
  return (make_pair(x[it.second] - x[it.first], y[it.second] - y[it.first]));
}
void dfs1(int second, int p) {
  int id = -1;
  for (int i = 0; i < g[second].size(); i++) {
    if (g[second][i] == p)
      id = i;
    else
      dfs1(g[second][i], second);
  }
  if (id != -1) {
    swap(g[second][id], g[second].back());
    g[second].pop_back();
  }
}
vector<int> second;
void dfs2(int ss, int p, int d) {
  second.push_back(ss);
  if (ss != d and second.size() >= 3) {
    bool c = 1;
    for (auto it : second)
      if (mul(vect(d, ss), vect(d, it)) < 0) {
        c = 0;
        break;
      }
    if (c) way[d][ss] = second;
  }
  for (auto it : g[ss])
    if (it != p) dfs2(it, ss, d);
  second.pop_back();
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  pair<int, int> aa = vect(a);
  pair<int, int> bb = vect(b);
  int ha = check(aa);
  int hb = check(bb);
  if (ha != hb) return ha < hb;
  long long pr = mul(aa, bb);
  if (pr != 0) return (pr > 0);
  return a < b;
}
bool good(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  int hb = check(a, b);
  int hc = check(a, c);
  if (hb != hc) return hb < hc;
  return mul(b, c) > 0;
}
vector<int> gg[MAXN];
vector<int> dfs(int p) {
  ml[p] = 1;
  vector<int> now = {p};
  for (auto it : g[p]) {
    vector<int> to = dfs(it);
    for (auto iti : to) now.push_back(iti);
    ml[p] = (long long)ml[p] * dp[it] % mod;
  }
  dp[p] = ml[p];
  for (auto it : g[p]) {
    int cur = ml[it];
    for (auto j : g[p])
      if (j != it) cur = (long long)cur * dp[j] % mod;
    dp[p] += cur;
    if (dp[p] >= mod) dp[p] -= mod;
  }
  for (auto i : now) gg[i].clear();
  int k = 0;
  for (auto i : now)
    for (auto j : g[i]) {
      gg[i].push_back(j);
      gg[j].push_back(i);
      e[i][j] = k++;
      e[j][i] = k++;
    }
  for (auto i : now)
    for (auto j : now) ok[i][j] = 0;
  vector<pair<int, int> > al;
  for (auto i : now)
    for (auto j : now)
      if (!way[i][j].empty() and mul(vect(i, j), vect(i, p)) >= 0) {
        al.push_back(make_pair(i, j));
        first[i][j] = e[way[i][j][0]][way[i][j][1]];
        last[i][j] = e[way[i][j][(int)way[i][j].size() - 1]]
                      [way[i][j][(int)way[i][j].size() - 2]];
        if (val[i][j] != -1) continue;
        ok[i][j] = 1;
        val[i][j] = 1;
        for (int x = 0; x < way[i][j].size(); x++) {
          int vv = way[i][j][x];
          pair<int, int> lb, rb;
          if (x == 0) {
            lb = vect(vv, way[i][j][x + 1]);
            lb.first = -lb.first;
            lb.second = -lb.second;
          } else
            lb = vect(vv, way[i][j][x - 1]);
          if (x + 1 == way[i][j].size()) {
            rb = vect(vv, way[i][j][x - 1]);
            rb.first = -rb.first;
            rb.second = -rb.second;
          } else
            rb = vect(vv, way[i][j][x + 1]);
          for (auto it : g[vv])
            if (good(lb, vect(vv, it), rb)) {
              if (x != 0 and it == way[i][j][x - 1]) continue;
              if (x + 1 < way[i][j].size() and it == way[i][j][x + 1]) continue;
              val[i][j] = (long long)val[i][j] * dp[it] % mod;
            }
        }
      }
  sort(al.begin(), al.end(), cmp);
  for (auto it : now)
    for (auto iti : gg[it]) {
      if (check(vect(it, iti))) continue;
      for (int b = -1; b <= 1; b += 2) {
        for (int i = 0; i < k; i++) sum[i] = 0;
        sum[e[it][iti]] = 1;
        for (auto t : al) {
          if (b == -1 and ok[t.first][t.second]) continue;
          int uu = first[t.first][t.second];
          int vv = last[t.first][t.second];
          sum[vv] += (long long)sum[uu] * val[t.first][t.second] % mod;
          if (sum[vv] >= mod) sum[vv] -= mod;
        }
        sum[e[it][iti]]--;
        if (sum[e[it][iti]] < 0) sum[e[it][iti]] += mod;
        dp[p] += b * sum[e[it][iti]];
        if (dp[p] >= mod) dp[p] -= mod;
        if (dp[p] < 0) dp[p] += mod;
      }
    }
  return now;
}
int main() {
  int tt = 1;
  while (tt--) {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
    for (int i = 0; i < n - 1; i++) {
      int uu, vv;
      cin >> uu >> vv;
      --uu;
      --vv;
      g[uu].push_back(vv);
      g[vv].push_back(uu);
    }
    for (int i = 0; i < n; i++) dfs2(i, -1, i);
    dfs1(0, -1);
    memset(val, -1, sizeof(val));
    dfs(0);
    cout << dp[0] << endl;
  }
  return 0;
}