#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define i_7 1000000007 #define i_5 1000000005 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; else return c+i_7; } typedef pair i_i; typedef pair l_l; #define inf 100000000/*10^8*/ /*#define rep(i,l,r) for(int i=l;i<=r;i++)*/ const double EPS=1E-8; //////////////////////////////////////// #define rep(i,l,r) for(ll i=l;i<=r;i++) int main() { ll n,k;cin>>n>>k; ll a[n];rep(i,0,n-1)cin>>a[i]; if(k<=1000000){ ll b[k]; ll all=0,sum=0; rep(i,0,n-1){ b[i]=a[i]; all=mod(all+b[i]); sum=mod(sum+b[i]); /*cout<