#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
class ProblemE {
 public:
  ProblemE(int _n) : n(_n), m(n - 1), tree(m), comb(n + 1), visited(n) {
    for (int i = 0; i < m; ++i) {
      cin >> tree[i].first >> tree[i].second;
      --tree[i].first;
      --tree[i].second;
    }
    comb[2] = 1;
    for (int i = 4; i <= n; i += 2) comb[i] = ((i - 1) * comb[i - 2]) % MOD;
  }
  ll Solve() {
    ll ans = 0;
    for (int s = 0; s < 1 << m; ++s) {
      ll sum = 1;
      fill(visited.begin(), visited.end(), false);
      for (int v = 0; v < n; ++v) {
        if (visited[v]) continue;
        int num_visited = Bfs(v, s);
        sum = (sum * comb[num_visited]) % MOD;
      }
      if (__builtin_popcount(s) % 2 != 0)
        ans = ((ans - sum) + MOD) % MOD;
      else
        ans = (ans + sum) % MOD;
    }
    return ans;
  }

 private:
  int n, m;
  vector<pair<int, int>> tree;
  vector<int> comb;
  vector<bool> visited;
  int Bfs(const int cur, const int ban) {
    visited[cur] = true;
    int res = 1;
    for (int i = 0; i < m; ++i) {
      int dst = (tree[i].first == cur) ? tree[i].second : -1;
      if (tree[i].second == cur) dst = tree[i].first;
      if (dst == -1 || visited[dst] || ban >> i & 1) continue;
      res += Bfs(dst, ban);
    }
    return res;
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  assert(n <= 20);
  ProblemE p(n);
  cout << p.Solve() << endl;
  return 0;
}
