#include<functional>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<string>
#include<cstdio>
#include<vector>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int N=100005;
long long n,a,b,dp[N][2];
vector<int> v[N];
long long dfs(int x,int c,int l)
{
	if(dp[x][c])
		return dp[x][c];
	int ans=1;
	for(int i=0;i<v[x].size();i++)
		if(v[x][i]!=l)
		{
			if(c)
				ans*=dfs(v[x][i],0,x),ans%=mod; 
			else
				ans*=(dfs(v[x][i],0,x)+dfs(v[x][i],1,x)),ans%=mod;
		}
	dp[x][c]=ans;
	return ans;
}
int main(){
	cin>>n;
	for(int i=1;i<n;i++)
	{
		cin>>a>>b;
		v[a].push_back(b);
		v[b].push_back(a);  
	}
	cout<<(dfs(0,0,-66666)+dfs(0,1,-66666))%mod;
	return 0;
}