#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair P; typedef pair E; #define MOD (1000000007ll) #define l_ength size void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } void add_mod(ll& a, ll b){ a += b; if(a>MOD){ a -= MOD; } } bool done[100100]; ll memo[100100]; int k,x[100100]; ll solve(int p){ int i; if(done[p]){ return memo[p]; } done[p] = true; if(!p){ memo[p] = 1ll; return memo[p]; } for(i=0; i> n >> k; for(i=0; i> x[i]; } cout << solve(n) << endl; return 0; }