#pragma GCC optimize (2)
#pragma G++ optimize (2)
#include <bits/stdc++.h>
#define ll long long
#define lowbit(x) (x&-x)
using namespace std;
const int N = 1e5+7, p = 1e9+7;
ll f[N][2];
vector<int> vec[N];
void dfs(int x, int fa)
{
    f[x][0] = f[x][1] = 1;
	for(int i = 0; i < vec[x].size(); i++)
	{
		int y = vec[x][i];
		if(y!=fa)
		{
			dfs(y, x);
			f[x][1] = f[x][1]*f[y][0]%p;
			f[x][0] = f[x][0]*(f[y][1]+f[y][0])%p;
		}
	}
	return;
}
int main()
{
	int n;
	scanf("%d", &n);
	for(int i = 2; i <= n; i++)
	{
		int u, v;
		scanf("%d%d", &u, &v);
		vec[u].push_back(v);
		vec[v].push_back(u);
	}
	dfs(1, 0);
	printf("%d\n", (f[1][0]+f[1][1])%p);
	return 0;
}