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 double eps = 1e-8;
const int D = 998244353;
const int MAXN = 105, MAXM = 205;
int n, X[MAXN], Y[MAXN];
vector<int> ver[MAXN], G[MAXN];
int f[MAXN], g[MAXN];
int mul[MAXN][MAXN], id[MAXN][MAXN], vis[MAXN][MAXN], cnt;
int st[MAXN][MAXN], ed[MAXN][MAXN], sum[MAXM];
int inv(int x) {
  int y = D - 2, ret = 1;
  while (y) {
    if (y & 1) ret = 1ll * ret * x % D;
    x = 1ll * x * x % D;
    y >>= 1;
  }
  return ret;
}
struct point {
  int x, y;
  point() { x = y = 0; }
  point(int xx, int yy) { x = xx, y = yy; }
  long long dis() { return x * x + y * y; }
};
long long operator*(const point &aa, const point &bb) {
  return 1ll * aa.x * bb.y - 1ll * aa.y * bb.x;
}
point mak(int x, int y) { return point(X[y] - X[x], Y[y] - Y[x]); }
bool check(point l, point v, point r) {
  bool hv = l * v < 0, hr = l * r < 0;
  return hv != hr ? hv < hr : v * r > 0;
}
bool down(point x) { return x.y < 0 || (x.y == 0 && x.x < 0); }
vector<int> line[MAXN][MAXN];
vector<int> stk;
void get_line(int u, int fa, int bg) {
  stk.push_back(u);
  if (stk.size() >= 3) {
    bool ok = 1;
    point vec = mak(bg, u);
    for (int x : stk)
      if (vec * mak(bg, x) < 0) {
        ok = 0;
        break;
      }
    if (ok) line[bg][u] = stk;
  }
  for (int v : ver[u])
    if (v != fa) get_line(v, u, bg);
  stk.pop_back();
}
struct edge {
  int x, y;
  edge() {}
  edge(int xx, int yy) { x = xx, y = yy; }
};
bool operator<(const edge &aa, const edge &bb) {
  point va = mak(aa.x, aa.y), vb = mak(bb.x, bb.y);
  int ha = down(va), hb = down(vb);
  if (ha != hb) return ha < hb;
  long long val = va * vb;
  if (val) return val > 0;
  return va.dis() < vb.dis();
}
vector<int> dfs(int u, int fa) {
  vector<int> node;
  node.push_back(u);
  g[u] = 1;
  for (int v : ver[u])
    if (v != fa) {
      vector<int> tmp = dfs(v, u);
      for (int x : tmp) node.push_back(x);
      g[u] = 1ll * g[u] * f[v] % D;
    }
  f[u] = g[u];
  for (int v : ver[u])
    if (v != fa) f[u] = (f[u] + 1ll * g[u] * inv(f[v]) % D * g[v]) % D;
  cnt = 0;
  for (int x : node)
    for (int y : ver[x])
      if (y != fa) id[x][y] = ++cnt;
  vector<edge> e;
  for (int x : node)
    for (int y : node) {
      if (line[x][y].empty()) continue;
      if (mak(x, y) * mak(x, u) < 0) continue;
      vector<int> pos = line[x][y];
      int len = pos.size();
      e.push_back(edge(x, y));
      st[x][y] = id[pos[0]][pos[1]];
      ed[x][y] = id[pos[len - 1]][pos[len - 2]];
      if (~mul[x][y]) continue;
      vis[x][y] = u;
      mul[x][y] = 1;
      for (int i = 0; i < len; i++) {
        point lst, nxt;
        if (i == 0) {
          lst = mak(pos[i], pos[i + 1]);
          lst.x = -lst.x, lst.y = -lst.y;
        } else
          lst = mak(pos[i], pos[i - 1]);
        if (i == len - 1) {
          nxt = mak(pos[i], pos[i - 1]);
          nxt.x = -nxt.x, nxt.y = -nxt.y;
        } else
          nxt = mak(pos[i], pos[i + 1]);
        for (int p : ver[pos[i]])
          if (p != fa) {
            if (i != 0 && p == pos[i - 1]) continue;
            if (i != len - 1 && p == pos[i + 1]) continue;
            if (check(lst, mak(pos[i], p), nxt))
              mul[x][y] = 1ll * mul[x][y] * f[p] % D;
          }
      }
    }
  sort(e.begin(), e.end());
  for (int x : node)
    for (int y : ver[x])
      if (y != fa) {
        if (down(mak(x, y))) continue;
        for (int i = 1; i <= cnt; i++) sum[i] = 0;
        sum[id[x][y]] = 1;
        for (edge te : e) {
          int a = st[te.x][te.y], b = ed[te.x][te.y];
          sum[b] = (sum[b] + 1ll * sum[a] * mul[te.x][te.y]) % D;
        }
        --sum[id[x][y]];
        f[u] = (f[u] + sum[id[x][y]]) % D;
        for (int i = 1; i <= cnt; i++) sum[i] = 0;
        sum[id[x][y]] = 1;
        for (edge te : e)
          if (vis[te.x][te.y] != u) {
            int a = st[te.x][te.y], b = ed[te.x][te.y];
            sum[b] = (sum[b] + 1ll * sum[a] * mul[te.x][te.y]) % D;
          }
        --sum[id[x][y]];
        f[u] = (f[u] + D - sum[id[x][y]]) % D;
      }
  return node;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &X[i], &Y[i]);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    ver[x].push_back(y);
    ver[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) get_line(i, 0, i);
  memset(mul, -1, sizeof(mul));
  dfs(1, 0);
  printf("%d\n", f[1]);
  return 0;
}