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;
long long scal(pair<long long, long long> a, pair<long long, long long> b) {
  return (long long)a.first * (long long)a.second +
         (long long)b.first * (long long)b.second;
}
long long mul(pair<long long, long long> a, pair<long long, long long> b) {
  return (long long)a.first * (long long)b.second -
         (long long)a.second * (long long)b.first;
}
int half(pair<long long, long long> a) {
  if (a.second > 0 || (a.second == 0 && a.first >= 0)) return 0;
  return 1;
}
int half(pair<long long, long long> a, pair<long long, long long> b) {
  long long pr = mul(a, b);
  if (pr != 0) return (pr <= 0);
  return (scal(a, b) < 0);
}
const int M = 210;
const int MOD = 998244353;
int n, x[M], y[M], dp[M], val[M][M], ml[M], ei[M][M], first[M][M], last[M][M],
    sum[2 * M], ok[M][M];
vector<int> v[M];
vector<int> way[M][M];
pair<long long, long long> vect(int i, int j) {
  return make_pair(x[j] - x[i], y[j] - y[i]);
}
pair<long long, long long> vect(pair<long long, long long> t) {
  return make_pair(x[t.second] - x[t.first], y[t.second] - y[t.first]);
}
void dfs_help(int p, int pr) {
  int id = -1;
  for (int i = 0; i < (int)v[p].size(); i++) {
    if (v[p][i] == pr)
      id = i;
    else
      dfs_help(v[p][i], p);
  }
  if (id != -1) {
    swap(v[p][id], v[p].back());
    v[p].pop_back();
  }
}
vector<int> _stack;
void dfs_way(int p, int pr, int st) {
  _stack.push_back(p);
  if (p != st && (int)_stack.size() >= 3) {
    bool ch = true;
    for (int i : _stack)
      if (mul(vect(st, p), vect(st, i)) < 0) {
        ch = false;
        break;
      }
    if (ch) way[st][p] = _stack;
  }
  for (int i : v[p])
    if (i != pr) dfs_way(i, p, st);
  _stack.pop_back();
}
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  pair<long long, long long> va = vect(a);
  pair<long long, long long> vb = vect(b);
  int ha = half(va);
  int hb = half(vb);
  if (ha != hb) return ha < hb;
  long long pr = mul(va, vb);
  if (pr != 0) return (pr > 0);
  return a < b;
}
bool good(pair<long long, long long> a, pair<long long, long long> b,
          pair<long long, long long> c) {
  int hb = half(a, b);
  int hc = half(a, c);
  if (hb != hc) return hb < hc;
  return mul(b, c) > 0;
}
vector<int> g[M];
vector<int> dfs(int p) {
  ml[p] = 1;
  vector<int> now = {p};
  for (int i : v[p]) {
    vector<int> to = dfs(i);
    for (int x : to) now.push_back(x);
    ml[p] = (long long)ml[p] * dp[i] % MOD;
  }
  dp[p] = ml[p];
  for (int i : v[p]) {
    int cur = ml[i];
    for (int j : v[p])
      if (j != i) cur = (long long)cur * dp[j] % MOD;
    dp[p] += cur;
    if (dp[p] >= MOD) dp[p] -= MOD;
  }
  for (int i : now) g[i].clear();
  int k = 0;
  for (int i : now)
    for (int j : v[i]) {
      g[i].push_back(j);
      g[j].push_back(i);
      ei[i][j] = k++;
      ei[j][i] = k++;
    }
  for (int i : now)
    for (int j : now) ok[i][j] = 0;
  vector<pair<long long, long long> > al;
  for (int i : now)
    for (int j : now)
      if (!way[i][j].empty() && mul(vect(i, j), vect(i, p)) >= 0) {
        al.push_back(make_pair(i, j));
        first[i][j] = ei[way[i][j][0]][way[i][j][1]];
        last[i][j] = ei[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 < (int)way[i][j].size(); x++) {
          int v_cur = way[i][j][x];
          pair<long long, long long> lb, rb;
          if (x == 0) {
            lb = vect(v_cur, way[i][j][x + 1]);
            lb.first = -lb.first, lb.second = -lb.second;
          } else
            lb = vect(v_cur, way[i][j][x - 1]);
          if (x + 1 == (int)way[i][j].size()) {
            rb = vect(v_cur, way[i][j][x - 1]);
            rb.first = -rb.first, rb.second = -rb.second;
          } else
            rb = vect(v_cur, way[i][j][x + 1]);
          for (int to : v[v_cur])
            if (good(lb, vect(v_cur, to), rb)) {
              if (x != 0 && to == way[i][j][x - 1]) continue;
              if (x + 1 < (int)way[i][j].size() && to == way[i][j][x + 1])
                continue;
              val[i][j] = (long long)val[i][j] * dp[to] % MOD;
            }
        }
      }
  sort(al.begin(), al.end(), cmp);
  for (int v_st : now)
    for (int ig : g[v_st]) {
      if (half(vect(v_st, ig))) continue;
      for (int ban = -1; ban <= 1; ban += 2) {
        for (int i = 0; i < k; i++) sum[i] = 0;
        sum[ei[v_st][ig]] = 1;
        for (pair<long long, long long> t : al) {
          if (ban == -1 && ok[t.first][t.second]) continue;
          int S = first[t.first][t.second];
          int F = last[t.first][t.second];
          sum[F] += (long long)sum[S] * val[t.first][t.second] % MOD;
          if (sum[F] >= MOD) sum[F] -= MOD;
        }
        sum[ei[v_st][ig]]--;
        if (sum[ei[v_st][ig]] < 0) sum[ei[v_st][ig]] += MOD;
        dp[p] += ban * sum[ei[v_st][ig]];
        if (dp[p] >= MOD) dp[p] -= MOD;
        if (dp[p] < 0) dp[p] += MOD;
      }
    }
  return now;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n - 1; i++) {
    int s, f;
    cin >> s >> f;
    s--, f--;
    v[s].push_back(f);
    v[f].push_back(s);
  }
  for (int i = 0; i < n; i++) dfs_way(i, -1, i);
  dfs_help(0, -1);
  memset(val, -1, sizeof(val));
  dfs(0);
  cout << dp[0] << "\n";
  return 0;
}