#include<stdio.h> #include<algorithm> usingnamespace std; #define ll long long constint mod=1000000007; int n,m; int a[1000020],dp[1000020],f[1000020]; int ans; inlineintrd(){ int x=0,f=1; char ch; while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return f*x; }