Problem: 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

Solution (in CPP):

Solution:
#include <iostream>
#include <set>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define rep(i,a,b) for(int i=a;i<=b;i++)
int a[200005];
int mx[200005];
int main(int argc, char** argv) {
	int n,k;
	cin>>n>>k;
	rep(i,1,n)
	{
		scanf("%d",&a[i]);
	}
	set<int>s;
	int ans=0;
	mx[1]=0;
	int fg=0;
	rep(i,2,n)
	{
		mx[i]=mx[i-1];
		if(a[i]<=a[i-1])
		{
		mx[i]=max(i-1,mx[i]);	
		}
		if(i>=k&&mx[i]>=i-k+1)
		{
			ans++;
		}
		else if(i>=k)
		{
			fg=1;
		}
	}
	rep(i,1,k+1)
	{
		s.insert(a[i]);
		if(i!=k+1)continue;
		set<int>::iterator it1,it2;
		it1=s.begin();
		it2=--s.end();
		if(*it1==a[1]&&*it2==a[k+1]&&mx[i]>=i-k)
		{
			ans--;
		}
	}
	rep(i,k+2,n)
	{
		s.erase(a[i-k-1]);
		s.insert(a[i]);
		set<int>::iterator it1,it2;
		it1=s.begin();
		it2=--s.end();
		if(*it1==a[i-k]&&*it2==a[i]&&mx[i]>=i-k)
		{
			ans--;
		}
	}
	
	
	cout<<ans+fg;
	return 0;
}