func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> g[100100];   pair<int, int> DFS(int now) {     int all[2][2] = {};     int odd = 1, eve = 0, codd, ceve, todd, teve, csz, sw[2];     pair<int, int> tmp;     all[0][0] = all[1][0] = 1;     for (int i = 0; i < g[now].size(); i++) {       tmp = DFS(g[now][i]);       codd = tmp.first;       ceve = tmp.second + 1;       todd = (1LL * odd * ceve % 1000000007 + 1LL * eve * codd % 1000000007) %              1000000007;       teve = (1LL * eve * ceve % 1000000007 + 1LL * odd * codd % 1000000007) %              1000000007;       eve = teve;       odd = todd;       all[0][0] = 1LL * all[0][0] * ceve % 1000000007;       sw[0] = (1LL * all[1][1] * codd % 1000000007 + all[1][0]) % 1000000007;       sw[1] = (1LL * all[1][0] * codd % 1000000007 + all[1][1]) % 1000000007;       all[1][1] = sw[1];       all[1][0] = sw[0];     }     return make_pair(         ((odd + odd - all[0][0]) % 1000000007 + 1000000007) % 1000000007,         ((eve + eve - all[1][1]) % 1000000007 + 1000000007) % 1000000007);   }   int main() {     int n, p, i;     pair<int, int> ans;     scanf( %d , &n);     for (i = 2; i <= n; i++) {       scanf( %d , &p);       g[p].push_back(i);     }     ans = DFS(1);     printf( %d n , (ans.first + ans.second) % 1000000007);     return 0;   }   