Camo needs a Christmas ribbon to celebrate this special day with her friends!
Given an integer array that contains N elements, and each element is an integer between 1 to K. We want to find the number of beautiful ribbons for Camo. A beautiful subarray has the following two properties:
1. The length of it is K.
2. Each number from 1 to K only appear once in the subarray.
Can you find out the number of beautiful ribbons in the given array? (notice that two beautiful ribbons can overlap)
For the testcase 1 ~ 6, 1 ≤ N, K ≤ 103
For the testcase 7 ~ 8, 1 ≤ N, K ≤ 106
The first line contains two integers N and K
The next line contains N integers, which is the element of the array. (1 ≤ Ai ≤ K)
Output the number of beautiful ribbons. Remember to print a newline character at the end of the line.