#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;
}
