This is 1526 A.D. Third Battle of Panipat between Babur and Ibrahim Lodi, the current ruler of India is going on. 

Realising that Lodi has much larger army, Babur planned to attack the cities of India to bring the moral of the soldiers of Lodi down.

Now, Lodi had been ordered by his ancestors that, if he is to rule India, the cities in India should be connected and this system should always form a tree.

Now, in 1526, India had N cities(numbered 0 to N-1) all connected by roads and the whole system formed a tree. Lodi had to plan to save his cities. So he decided to use his special power S.H.I.E.L.D. And since all the other cities would be destroyed he wanted the protected cities system should form a tree.

S.H.I.E.L.D was an expensive power and Lodi decided that he would use it only on some specific cities. 
Now you being the prime minister of the ruler, need to tell him in how many ways he can do this. Lodi may even not use this power at all on any city or he may even select all the cities.

INPUT

First line contains the N: number of cities. 

Next N-1 lines contain u and v, denoting a path between city number 'u' and city number 'v'.

OUTPUT

Print the required number of ways modulo 10^9 + 7.

CONSTRAINTS

2 ≤ N ≤ 10^5

0 ≤ u,v < N

Given arrangement will be a tree.

SAMPLE INPUT
3
0 1
1 2

SAMPLE OUTPUT
7

Explanation

He has eight options. {},{0},{1},{2},{0,1},{1,2},{0,2},{0,1,2}.
But he cannot select {0,2} since this system doesn't form a tree.
n=int(raw_input())
r=[True]*(n)
G=[[] for i in xrange(n)]
A=[-1]*(n)
B=[-1]*(n)
m=(10**9+7)
for i in xrange(n-1):
    u,v=map(int,raw_input().split())
    G[u].append(v)
    r[v]=False
for i in xrange(0,n):
    if r[i]==True:
        root=i
def f(x):
    #print x
    p=1
    t=0
    if len(G[x])==0:
        A[x]=1
        B[x]=0
        #return (A[x],B[x])
    else:
        for i in G[x]:
            #print "i",i
            if A[i]!=-1 and B[i]!=-1:
             #x,y=f(i)
             p=p*(1+A[i])
             p%=m
             t+=(A[i]+B[i])
             t%=m
            else:
                f(i)
                p=p*(1+A[i])
                p%=m
                t+=(A[i]+B[i])
                t%=m
        A[x]=p
        B[x]=t
    #return A[x]+B[x]
f(root)
#print A,B
print (A[root]+B[root]+1)%m