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 Mod = 998244353;
int n;
struct Vec {
  long long x, y;
  Vec(long long a = 0, long long b = 0) {
    x = a;
    y = b;
  }
} A[110];
Vec operator+(const Vec& a, const Vec& b) { return Vec(a.x + b.x, a.y + b.y); }
Vec operator-(const Vec& a, const Vec& b) { return Vec(a.x - b.x, a.y - b.y); }
long long operator*(const Vec& a, const Vec& b) {
  return a.x * b.y - a.y * b.x;
}
int dir(Vec v) {
  if (v.x >= 0 && v.y >= 0) return 0;
  if (v.x < 0 && v.y >= 0) return 1;
  if (v.x < 0 && v.y < 0) return 2;
  if (v.x >= 0 && v.y < 0) return 3;
}
bool check_left(int i, int j, int k) {
  return (A[j] - A[i]) * (A[k] - A[i]) >= 0;
}
bool check_right(int i, int j, int k) {
  return (A[j] - A[i]) * (A[k] - A[i]) < 0;
}
bool check_ok(Vec a, Vec b, Vec c) {
  long long s1 = a * b;
  long long s2 = a * c;
  if (s1 >= 0 && s2 < 0) return true;
  if (s1 < 0 && s2 > 0) return false;
  return b * c > 0;
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  Vec va = A[a.second] - A[a.first];
  Vec vb = A[b.second] - A[b.first];
  if (dir(va) != dir(vb)) return dir(va) < dir(vb);
  long long cross = va * vb;
  if (cross != 0) return cross > 0;
  return a < b;
}
vector<int> e[110];
vector<int> path[110][110];
bool good[110][110];
void find_path(int u, int lst, int s) {
  path[s][u] = path[s][lst];
  path[s][u].push_back(u);
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (v == lst) continue;
    find_path(v, u, s);
  }
  return;
}
void dfs(int u, int lst) {
  int pos = -1;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (v == lst)
      pos = i;
    else
      dfs(v, u);
  }
  if (pos != -1) {
    swap(e[u][pos], e[u].back());
    e[u].pop_back();
  }
  return;
}
bool check_good(int u, int v, vector<int>& vec) {
  if (vec.size() < 3) return false;
  for (int i = 0; i < vec.size(); i++)
    if (!check_left(u, v, vec[i])) return false;
  return true;
}
void init_good() {
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) good[i][j] = check_good(i, j, path[i][j]);
  return;
}
long long dp[110];
long long value[110][110];
bool vis[110];
int calc_value(vector<int>& vec) {
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < vec.size(); i++) vis[vec[i]] = true;
  long long res = 1;
  for (int i = 0; i < vec.size(); i++) {
    int u = vec[i];
    Vec v1, v2;
    if (i > 0)
      v1 = A[vec[i - 1]] - A[u];
    else
      v1 = A[u] - A[vec[i + 1]];
    if (i + 1 < vec.size())
      v2 = A[vec[i + 1]] - A[u];
    else
      v2 = A[u] - A[vec[i - 1]];
    for (int j = 0; j < e[u].size(); j++) {
      int v = e[u][j];
      if (vis[v]) continue;
      if (check_ok(v1, A[v] - A[u], v2)) res = res * dp[v] % Mod;
    }
  }
  return res;
}
long long f[210];
int id[110][110];
int first[110][110], last[110][110];
bool ok[110][110];
bool bl[210];
vector<int> solve(int u) {
  vector<int> vec;
  vec.push_back(u);
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    vector<int> to = solve(v);
    for (int j = 0; j < to.size(); j++) vec.push_back(to[j]);
  }
  dp[u] = 0;
  long long sum = 1;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    sum = sum * dp[v] % Mod;
  }
  dp[u] = (dp[u] + sum) % Mod;
  sum = 0;
  for (int i = 0; i < e[u].size(); i++) {
    long long tmp = 1;
    for (int j = 0; j < e[u].size(); j++)
      if (i != j) tmp = tmp * dp[e[u][j]] % Mod;
    int v = e[u][i];
    for (int j = 0; j < e[v].size(); j++) tmp = tmp * dp[e[v][j]] % Mod;
    sum = (sum + tmp) % Mod;
  }
  dp[u] = (dp[u] + sum) % Mod;
  int num = 0;
  memset(bl, 0, sizeof(bl));
  for (int i = 0; i < vec.size(); i++) {
    int a = vec[i];
    for (int j = 0; j < e[a].size(); j++) {
      int b = e[a][j];
      id[a][b] = ++num;
      id[b][a] = ++num;
      if (dir(A[b] - A[a]) <= 1)
        bl[id[a][b]] = 1;
      else
        bl[id[b][a]] = 1;
    }
  }
  vector<pair<int, int> > V;
  for (int i = 0; i < vec.size(); i++)
    for (int j = 0; j < vec.size(); j++) {
      int a = vec[i], b = vec[j];
      ok[a][b] = false;
      if (!check_left(a, b, u)) continue;
      if (!good[a][b]) continue;
      V.push_back(make_pair(a, b));
      int sz = path[a][b].size();
      int x = path[a][b][0], y = path[a][b][1];
      first[a][b] = id[x][y];
      x = path[a][b][sz - 1];
      y = path[a][b][sz - 2];
      last[a][b] = id[x][y];
      if (value[a][b] != -1) continue;
      ok[a][b] = 1;
      value[a][b] = calc_value(path[a][b]);
    }
  sort(V.begin(), V.end(), cmp);
  for (int s = 1; s <= num; s++) {
    if (!bl[s]) continue;
    for (int c = -1; c <= 1; c += 2) {
      memset(f, 0, sizeof(f));
      f[s] = 1;
      for (int i = 0; i < V.size(); i++) {
        int x = V[i].first;
        int y = V[i].second;
        if (c == -1 && ok[x][y]) continue;
        int fr = first[x][y];
        int to = last[x][y];
        f[to] = (f[to] + f[fr] * value[x][y]) % Mod;
      }
      f[s] = (f[s] + Mod - 1) % Mod;
      dp[u] = (dp[u] + c * f[s] + Mod) % Mod;
    }
  }
  return vec;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d %I64d", &A[i].x, &A[i].y);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) find_path(i, 0, i);
  dfs(1, 0);
  init_good();
  memset(value, -1, sizeof(value));
  solve(1);
  printf("%I64d\n", dp[1]);
  return 0;
}