#include #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair P; int n,k; int a[1000001]; int dp[1000001]; int cnt[1001]; int main(void){ scanf("%d%d",&n,&k); for(int i=0;i