Snuke has a permutation (P_0,P_1,\cdots,P_{N-1}) of (0,1,\cdots,N-1).

Now, he will perform the following operation exactly once:

* Choose K consecutive elements in P and sort them in ascending order.



Find the number of permutations that can be produced as P after the operation.

Constraints

* 2 \leq N \leq 200000
* 2 \leq K \leq N
* 0 \leq P_i \leq N-1
* P_0,P_1,\cdots,P_{N-1} are all different.
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N K
P_0 P_1 \cdots P_{N-1}


Output

Print the number of permutations that can be produced as P after the operation.

Examples

Input

5 3
0 2 1 4 3


Output

2


Input

4 4
0 1 2 3


Output

1


Input

10 4
2 0 1 3 7 5 4 6 8 9


Output

6
#include<bits/stdc++.h>
using namespace std;
#define maxn 200000
int a[maxn+5],b[maxn+5],c[maxn+5],t1,t2,n,k;
bool vis[maxn+5];
void insert1(int x){
	vis[x]=1;
	while(t1&&b[t1]>x)vis[b[t1]]=0,t1--;
	b[++t1]=x;
}
void insert2(int x){
	while(t2&&a[c[t2]]<a[x])t2--;
	c[++t2]=x;
}
int main(){
//	freopen("1.in","r",stdin);
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",a+i),a[i]++;
	int ans1=n-k+1,mx=0,x;bool fl=0;
	for(int i=1;i<=k;i++)mx=(a[i]>a[i-1]?mx+1:1),insert1(a[i]),insert2(i);
	if(mx>=k)fl=1;
	for(int i=k+1;i<=n;i++){
		insert1(a[i]),insert2(i);
		mx=(a[i]>a[i-1]?mx+1:1);
		if(mx>=k){
			if(fl)ans1--;
			else fl=1;
		}
		else if(vis[a[i-k]]&&(t2<2||c[t2-1]<=i-k))ans1--;
	}
	printf("%d",ans1);
	return 0;
}