#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::io::{self, BufRead};

#[allow(unused)]
macro_rules! input_at_once {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner_for_input_at_once!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner_for_input_at_once!{iter, $($r)*}
    };
}

#[allow(unused)]
macro_rules! input_inner_for_input_at_once {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value_for_input_at_once!($iter, $t);
        input_inner_for_input_at_once!{$iter $($r)*}
    };
}

#[allow(unused)]
macro_rules! read_value_for_input_at_once {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value_for_input_at_once!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value_for_input_at_once!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value_for_input_at_once!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value_for_input_at_once!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

const P: usize = 1_000_000_000 + 7;

fn dfs_size(
  g: &Vec<Vec<usize>>,
  size: &mut Vec<usize>,
  i: usize,
  used: &mut Vec<bool>,
) {
  used[i] = true;
  size[i] = 1;
  for v in g[i].iter() {
    if used[*v] {
      continue;
    }
    dfs_size(g, size, *v, used);
    size[i] += size[*v];
  }
}

fn dfs_solve(
  g: &Vec<Vec<usize>>,
  used: &mut Vec<bool>,
  size: &Vec<usize>,
  i: usize,
  pair_count: &Vec<usize>,
) -> Vec<[usize; 2]> {
  used[i] = true;
  let mut ret = vec![[0; 2]; 2];
  ret[1][0] = 1;
  let mut current_size = 1;
  for v in g[i].iter() {
    if used[*v] {
      continue;
    }
    let c = dfs_solve(g, used, size, *v, pair_count);
    let mut tmp = vec![[0; 2]; current_size + size[*v] + 1];
    for x in 1..current_size + 1 {
      for y in 1..size[*v] + 1 {
        for m1 in 0..2 {
          for m2 in 0..2 {
            tmp[x + y][(m1 + m2) % 2] += (ret[x][m1] * c[y][m2]) % P;
            tmp[x + y][(m1 + m2) % 2] %= P;
            tmp[x][(m1 + m2 + 1) % 2] +=
              (((ret[x][m1] * pair_count[y]) % P) * c[y][m2]) % P;
            tmp[x][(m1 + m2 + 1) % 2] %= P;
          }
        }
      }
    }
    ret = tmp;
    current_size += size[*v];
  }
  ret
}

fn main() {
  // pray for AC
  input!{
    n: usize,
    xy: [[usize; 2]; n-1],
  };
  let xy: Vec<_> = xy
    .into_iter()
    .map(|xyi| vec![xyi[0] - 1, xyi[1] - 1])
    .collect();
  let mut g = vec![vec![]; n];
  for xyi in xy.iter() {
    let x = xyi[0];
    let y = xyi[1];
    g[x].push(y);
    g[y].push(x);
  }

  let mut size = vec![0; n];
  dfs_size(&g, &mut size, 0, &mut vec![false; n]);

  //let mut dp = vec![vec![vec![0; 2]; n + 1]; n];
  let mut pair_count = vec![0; 5001];
  pair_count[0] = 1;
  for i in 2..5001 {
    if i % 2 == 1 {
      continue;
    }
    pair_count[i] = (pair_count[i - 2] * (i - 1)) % P;
  }
  let dp = dfs_solve(&g, &mut vec![false; n], &size, 0, &pair_count);

  let mut ans = 0;
  for s in 1..size[0] + 1 {
    ans += ((dp[s][0] * pair_count[s]) % P
      + (P - ((dp[s][1] * pair_count[s]) % P)))
      % P;
    ans %= P;
  }
  println!("{}", ans);
}


Measured memory_bytes: 7676