#include <bits/stdc++.h>
using namespace std;
const int N = 105, P = 998244353;
using pii = pair<int, int>;
using ll = long long;
ll f[N], dp[N], dp2[N << 1], val[N][N];
vector<int> v[N], w[N][N], d[N];
pii a[N];
int n, rt, e[N][N], fs[N][N], lst[N][N], clr[N][N];
void dfsw(int pos, int fa) {
  w[rt][pos] = w[rt][fa];
  w[rt][pos].push_back(pos);
  for (auto &i : v[pos])
    if (i != fa) dfsw(i, pos);
}
inline ll cs(pii a, pii b) {
  return a.first * 1ll * b.second - a.second * 1ll * b.first;
}
bool half(pii x) { return x.second < 0 || (x.second == 0 && x.first < 0); }
pii operator-(const pii &a, const pii &b) {
  return {a.first - b.first, a.second - b.second};
}
bool chk(pii x, pii y) {
  pii aa = a[x.second] - a[x.first], bb = a[y.second] - a[y.first];
  int xx = half(aa), yy = half(bb);
  return xx == yy ? cs(aa, bb) > 0 : xx < yy;
}
void dfs(int pos, int fa) {
  for (auto it = v[pos].begin(); it != v[pos].end(); it++)
    if (*it == fa) {
      v[pos].erase(it);
      break;
    }
  d[pos].push_back(pos);
  for (auto &i : v[pos]) {
    dfs(i, pos);
    for (auto &j : d[i]) d[pos].push_back(j);
  }
  f[pos] = 1;
  for (auto &i : v[pos]) f[pos] = f[pos] * dp[i] % P;
  dp[pos] = f[pos];
  for (auto &i : v[pos]) {
    ll tt = f[i];
    for (auto &j : v[pos])
      if (i != j) tt = tt * dp[j] % P;
    dp[pos] = (dp[pos] + tt) % P;
  }
  int kk = 0;
  memset(e, 0, sizeof(e));
  for (auto &i : d[pos])
    for (auto &j : v[i]) e[i][j] = ++kk, e[j][i] = ++kk;
  vector<pii> al;
  sort(d[pos].begin(), d[pos].end(), [](int x, int y) {
    return a[x].second == a[y].second ? a[x].first < a[y].first
                                      : a[x].second < a[y].second;
  });
  int m = d[pos].size();
  for (auto &i : d[pos])
    for (auto &j : d[pos])
      if (w[i][j].size() >= 3 && cs(a[j] - a[i], a[pos] - a[i]) >= 0) {
        al.push_back({i, j});
        int sz = w[i][j].size();
        fs[i][j] = e[w[i][j][0]][w[i][j][1]];
        lst[i][j] = e[w[i][j][sz - 1]][w[i][j][sz - 2]];
        clr[i][j] = 0;
        val[i][j] = 1;
        for (int k = 0; k < sz; k++) {
          int x = k ? w[i][j][k - 1] : -1,
              y = k <= sz - 2 ? w[i][j][k + 1] : -1, dq = w[i][j][k];
          for (auto &s : v[dq]) {
            if (s == x || s == y) continue;
            if (x < 0) {
              if (cs(a[y] - a[dq], a[s] - a[dq]) > 0) continue;
            } else if (y < 0) {
              if (cs(a[s] - a[x], a[dq] - a[x]) < 0) continue;
            } else {
              int aa = cs(a[y] - a[dq], a[s] - a[dq]) > 0,
                  bb = cs(a[s] - a[x], a[dq] - a[x]) < 0;
              if (cs(a[dq] - a[x], a[y] - a[x]) > 0) {
                if (aa && bb) continue;
              } else if (aa || bb)
                continue;
            }
            val[i][j] = val[i][j] * dp[s] % P;
          }
          clr[i][j] |= dq == pos;
        }
      }
  sort(al.begin(), al.end(), chk);
  for (int i = 0; i < m; i++)
    for (int j = i + 1; j < m; j++)
      if (e[d[pos][i]][d[pos][j]])
        for (int ban = -1; ban <= 1; ban += 2) {
          memset(dp2, 0, sizeof(dp2));
          dp2[e[d[pos][i]][d[pos][j]]] = 1;
          for (auto &s : al) {
            if (ban == -1 && clr[s.first][s.second]) continue;
            int ss = fs[s.first][s.second], tt = lst[s.first][s.second];
            dp2[tt] = (dp2[tt] + dp2[ss] * val[s.first][s.second]) % P;
          }
          dp2[e[d[pos][i]][d[pos][j]]] += P - 1;
          dp[pos] += ban * dp2[e[d[pos][i]][d[pos][j]]];
        }
  dp[pos] = (dp[pos] % P + P) % P;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 1; i < n; i++) {
    int t1, t2;
    cin >> t1 >> t2;
    v[t1].push_back(t2);
    v[t2].push_back(t1);
  }
  for (int i = 1; i <= n; i++) {
    rt = i;
    dfsw(i, 0);
    for (int j = 1; j <= n; j++) {
      for (auto &k : w[i][j])
        if (cs(a[j] - a[i], a[k] - a[i]) < 0) {
          w[i][j].clear();
          break;
        }
    }
  }
  dfs(1, 0);
  cout << dp[1] << endl;
  return 0;
}
