#include using namespace std; using LL=long long; templatevoid sort(vector &v){sort(v.begin(),v.end());} templateint lower_bound(vector &v, T key){ return distance(v.begin(), lower_bound(v.begin(),v.end(),key)); } templateint upper_bound(vector &v, T key){ return distance(v.begin(), upper_bound(v.begin(), v.end(), key)); } int main(){ const int mod=1000000007; int n,p;cin>>n>>p; vector a(n);for(auto &i:a)cin>>i; a[0]=0;a[1]=1; for(int i=2;i