#include <bits/stdc++.h>
using namespace std;
int toint(const string &s) {
  stringstream ss;
  ss << s;
  int x;
  ss >> x;
  return x;
}
string tostring(int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
long long pw(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long ans = pw(a, b / 2);
  if (b & 1) return (((ans * ans) % 1000000007 * a) % 1000000007);
  return (ans * ans) % 1000000007;
}
long long const NMAX = 2e5 + 20;
long long val[NMAX];
bool mark[NMAX];
vector<int> adj_list[NMAX];
void dfs(int node) {
  mark[node] = 1;
  val[node] = 1;
  int cnt = 0;
  for (auto child : adj_list[node])
    if (!mark[child]) {
      dfs(child);
      val[node] = (val[node] * val[child]) % 1000000007;
      cnt = 1;
    }
  if (cnt) val[node] = (val[node] * 2) % 1000000007;
}
long long tot = 0;
void calc(int node, long long parent = 1, int ex = 0) {
  mark[node] = 1;
  if (ex && adj_list[node].size() == 1)
    tot = (tot + 2 * (val[node] * parent) % 1000000007) % 1000000007;
  else
    tot = (tot + (val[node] * parent) % 1000000007) % 1000000007;
  int sz = adj_list[node].size();
  for (auto child : adj_list[node])
    if (!mark[child]) {
      if (sz == 1)
        calc(child,
             ((parent * val[node]) % 1000000007 *
              pw(val[child] * 2, 1000000007 - 2) % 1000000007) %
                 1000000007,
             1);
      else
        calc(child,
             ((parent * val[node]) % 1000000007 *
              pw(val[child], 1000000007 - 2) % 1000000007) %
                 1000000007,
             1);
    }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d", &a);
    scanf("%d", &b);
    adj_list[a].push_back(b);
    adj_list[b].push_back(a);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) mark[i] = 0;
  calc(1);
  printf("%lld\n", tot);
  return 0;
}
