Language: C++

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <iomanip>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << endl
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
int dx8[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;


ll modpow(ll a,ll n, ll mod){
    ll res = 1;
    while(n > 0){
        if(n & 1) res = res * a%mod;
        a = a*a%mod;
    n >>=1;
    }
    return res;
}
ll modMinus(ll val,ll m){
    ll res = val % m;
    if(res < 0) res += m;
        return res;
}
 void modAdd(int &a,int b){
a += b;
if(a >= MOD) a-= MOD;
}

ll dp[100010][2];//[現在の頂点][WorB]=場合の数,白が0、黒が１

void dfs(vvi &G,int v,int p){
   //子供がないときの白も黒も1通り
   for(int child:G[v]){
       if(child == p) continue;//逆流禁止
       //先に葉まで行く
       dfs(G,child,v);
   }

   //nextがない葉まできたら
   dp[v][0]=1;
   dp[v][1]=1;

   //ここからは葉をみて返ってきたとき
   for(int child:G[v]){
       //子供二人分を親に入れていく
       if(child == p) continue;
       dp[v][0] *= dp[child][1];//dp[v][0]=1;を入れているので掛け算おｋ
       dp[v][1] *= (dp[child][0] + dp[child][1]);
   }

}
int main(void) {
    int N;
    cin >> N;
    vvi G(N);
    rep(i,N){
        int x,y;
        cin >> x >> y;
        x--,y--;//0index
        G[x].push_back(y);
        G[y].push_back(x);
    }
    //dp[i][0] += (dp[iの子供1][0]+dp[iの子供１][1])×(dp[iの子供2][0]+dp[iの子供2][1])
    //dp[i][1] += (dp[iの子供1][0])×(dp[iの子供2][0])　黒の子供は白でなくてはならない

    dfs(G,0,-1);

    //答えはroot=0を黒で塗った時と白で塗った時の合計
    fin(modAdd(dp[0][1],dp[0][0]));

}

Compiler output:
a.cc: In function 'int main()':
a.cc:120:23: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'll' {aka 'long long int'}
  120 |     fin(modAdd(dp[0][1],dp[0][0]));
      |                ~~~~~~~^
a.cc:39:27: note: in definition of macro 'fin'
   39 | #define fin(ans) cout << (ans) << endl
      |                           ^~~
a.cc:75:19: note:   initializing argument 1 of 'void modAdd(int&, int)'
   75 |  void modAdd(int &a,int b){
      |              ~~~~~^