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.
#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 105, mod = 998244353;
long long f[N], dp[N], DP[N << 1], val[N][N];
vector<int> v[N], way[N][N], d[N];
pair<int, int> a[N];
int n, rt, e[N][N], fir[N][N], lst[N][N], cover[N][N];
void dfs_way(int p, int fa) {
  way[rt][p] = way[rt][fa];
  way[rt][p].push_back(p);
  for (auto i : v[p])
    if (i != fa) dfs_way(i, p);
}
long long mul(pair<int, int> a, pair<int, int> b) {
  return (long long)a.first * b.second - (long long)a.second * b.first;
}
pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
bool cmp(int x, int y) {
  return a[x].second == a[y].second ? a[x].first < a[y].first
                                    : a[x].second < a[y].second;
}
int half(pair<int, int> x) {
  return x.second < 0 || (x.second == 0 && x.first < 0);
}
bool cnm(pair<int, int> x, pair<int, int> y) {
  pair<int, int> A = a[x.second] - a[x.first], B = a[y.second] - a[y.first];
  int X = half(A), Y = half(B);
  return X == Y ? mul(A, B) > 0 : X < Y;
}
void dfs(int p, int fa) {
  for (auto it = v[p].begin(); it != v[p].end(); it++)
    if (*it == fa) {
      v[p].erase(it);
      break;
    }
  d[p].push_back(p);
  for (auto i : v[p]) {
    dfs(i, p);
    for (auto j : d[i]) d[p].push_back(j);
  }
  f[p] = 1;
  for (auto i : v[p]) f[p] = f[p] * dp[i] % mod;
  dp[p] = f[p];
  for (auto i : v[p]) {
    long long zs = f[i];
    for (auto j : v[p])
      if (i != j) zs = zs * dp[j] % mod;
    dp[p] = (dp[p] + zs) % mod;
  }
  int k = 0;
  memset((e), 0, sizeof(e));
  for (auto i : d[p])
    for (auto j : v[i]) {
      e[i][j] = ++k;
      e[j][i] = ++k;
    }
  vector<pair<int, int> > al;
  sort(d[p].begin(), d[p].end(), cmp);
  int m = d[p].size();
  for (auto i : d[p])
    for (auto j : d[p])
      if (way[i][j].size() >= 3 && mul(a[j] - a[i], a[p] - a[i]) >= 0) {
        al.push_back(make_pair(i, j));
        int sz = way[i][j].size();
        fir[i][j] = e[way[i][j][0]][way[i][j][1]];
        lst[i][j] = e[way[i][j].back()][way[i][j][sz - 2]];
        cover[i][j] = 0;
        val[i][j] = 1;
        for (int o = (int)(0); o <= (int)(sz - 1); o++) {
          int x = o ? way[i][j][o - 1] : -1,
              y = o <= sz - 2 ? way[i][j][o + 1] : -1, dq = way[i][j][o];
          for (auto son : v[dq])
            if (son != x && son != y) {
              if (x < 0) {
                if (mul(a[y] - a[dq], a[son] - a[dq]) > 0) continue;
              } else if (y < 0) {
                if (mul(a[son] - a[x], a[dq] - a[x]) < 0) continue;
              } else {
                int A = mul(a[y] - a[dq], a[son] - a[dq]) > 0,
                    B = mul(a[son] - a[x], a[dq] - a[x]) < 0;
                if (mul(a[dq] - a[x], a[y] - a[x]) > 0) {
                  if (A && B) continue;
                } else {
                  if (A || B) continue;
                }
              }
              val[i][j] = val[i][j] * dp[son] % mod;
            }
          cover[i][j] |= dq == p;
        }
      }
  sort(al.begin(), al.end(), cnm);
  for (int i = (int)(0); i <= (int)(m - 1); i++)
    for (int j = (int)(i + 1); j <= (int)(m - 1); j++)
      if (e[d[p][i]][d[p][j]]) {
        for (int ban = -1; ban <= 1; ban += 2) {
          memset((DP), 0, sizeof(DP));
          DP[e[d[p][i]][d[p][j]]] = 1;
          for (auto o : al) {
            if (ban == -1 && cover[o.first][o.second]) continue;
            int S = fir[o.first][o.second], T = lst[o.first][o.second];
            DP[T] = (DP[T] + DP[S] * val[o.first][o.second]) % mod;
          }
          DP[e[d[p][i]][d[p][j]]] += mod - 1;
          dp[p] += ban * DP[e[d[p][i]][d[p][j]]];
        }
      }
  dp[p] = (dp[p] % mod + mod) % mod;
}
int main() {
  n = read();
  for (int i = (int)(1); i <= (int)(n); i++) {
    a[i].first = read();
    a[i].second = read();
  }
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int s = read(), t = read();
    v[s].push_back(t);
    v[t].push_back(s);
  }
  for (int i = (int)(1); i <= (int)(n); i++) {
    rt = i;
    dfs_way(i, 0);
    for (int j = (int)(1); j <= (int)(n); j++) {
      for (auto k : way[i][j])
        if (mul(a[j] - a[i], a[k] - a[i]) < 0) {
          way[i][j].clear();
          break;
        }
    }
  }
  dfs(1, 0);
  cout << dp[1] << endl;
}
