#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(int x) {
  static const int maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  int len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (int i = len - 1; i >= 0; --i) putchar(s[i]);
}
const int MAXN = 110000;
const int MAXM = 210000;
int du[MAXN];
const long long P = 1000000007ll;
int n;
int main() {
  read(n);
  for (int i = 1; i < n; i++) {
    int a, b;
    read(a);
    read(b);
    du[a]++;
    du[b]++;
  }
  long long tmp = 0;
  for (int i = 1; i <= n; i++)
    if (du[i] == 1) tmp++;
  long long ans = 1;
  for (int i = 1; i <= n - tmp; i++) ans = ans * 2ll % P;
  printf("%I64d\n", 1ll * (n + tmp) * ans % P);
  return 0;
}
