#include <bits/stdc++.h>
using namespace std;
void prll(vector<long long>& v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << ' ';
  }
  cout << endl;
}
void prll(vector<char>& v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << ' ';
  }
  cout << endl;
}
void prll(vector<string>& v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << ' ';
  }
  cout << endl;
}
void prll(vector<bool>& v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << ' ';
  }
  cout << endl;
}
void prll(vector<pair<long long, long long>>& v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i].first << ',' << v[i].second << '|';
  }
  cout << endl;
}
void prll(vector<vector<long long>>& v) {
  for (long long i = 0; i < v.size(); i++) {
    prll(v[i]);
  }
}
void prll(vector<vector<bool>>& v) {
  for (long long i = 0; i < v.size(); i++) {
    prll(v[i]);
  }
}
long long R = pow(10, 9) + 7;
long long power(long long x, long long y) {
  long long res = 1;
  x = x % R;
  if (x == 0) return 0;
  while (y > 0) {
    if (y % 2 == 1) res = (res * x) % R;
    y /= 2;
    x = (x * x) % R;
  }
  return res;
}
void TestCase() {
  long long n;
  cin >> n;
  vector<vector<long long>> adj(n);
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long leaves = 0;
  long long nodes = 0;
  for (long long i = 0; i < n; i++) {
    if (adj[i].size() > 1)
      nodes++;
    else
      leaves++;
  }
  long long ans = power(2, nodes);
  ans *= (n + leaves);
  ans %= R;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T;
  T = 1;
  for (long long tt = 1; tt <= T; tt++) {
    TestCase();
  }
}
