#include<iostream>
#include<vector>
using namespace std;
long mod=1e9+7,a[1<<17],b[1<<17];
int n;
vector<int>G[1<<17];
long f(int,int);
long g(int,int);
long f(int u,int p)
{
	if(a[u])return a[u];
	a[u]=1;
	for(int i=0;i<G[u].size();i++)if(p!=G[u][i])a[u]=a[u]*g(G[u][i],u)%mod;
	return a[u]=(a[u]+g(u,p))%mod;
}
long g(int u,int p)
{
	if(b[u])return b[u];
	b[u]=1;
	for(int i=0;i<G[u].size();i++)if(p!=G[u][i])b[u]=b[u]*f(G[u][i],u)%mod;
	return b[u];
}
int main()
{
	cin>>n;
	for(int i=1;i<n;i++)
	{
		int x,y;cin>>x>>y;
		G[x].push_back(y);
		G[y].push_back(x);
	}
	cout<<f(1,0)<<endl;
}