#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <typename T>
inline void getint(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <typename T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
vector<int> adj[100100];
int dp[100100], ans[100100], f[100100];
void dfs(int u, int fa = 0) {
  dp[u] = 1;
  f[u] = 0;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    f[u]++;
    dfs(v, u);
    dp[u] = (long long)dp[u] * dp[v] % 1000000007;
  }
  if (f[u]) dp[u] = dp[u] * 2 % 1000000007;
}
void redfs(int u, int fa = 0, int pre = 1) {
  if (f[u] || !f[u] && !fa)
    ans[u] = (long long)dp[u] * pre % 1000000007;
  else
    ans[u] = 2LL * dp[u] * pre % 1000000007;
  f[u] += (fa > 0);
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    int tmp;
    tmp = (long long)ans[u] * power(dp[v], 1000000007 - 2, 1000000007) %
          1000000007;
    if (f[u] == 1)
      tmp = (long long)tmp * power(2, 1000000007 - 2, 1000000007) % 1000000007;
    redfs(v, u, tmp);
  }
}
int main() {
  int n, u, v;
  cin >> n;
  for (int i = 1; i < n; i++) {
    getint(u);
    getint(v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1);
  redfs(1);
  long long sum = 0;
  for (int i = 1; i <= n; i++) sum += ans[i];
  cout << sum % 1000000007 << endl;
  return 0;
}
