~A~ of integers ~(1 \le A_i \le M)~, find the total number of good subarrays.has found a problem, and he needs your help! Given an array
A subarray is good if it is non-empty and for every number from ~1~ to ~M~, they all appear the same number of times.
The first line of input contains ~N~, the length of the array and ~M~.
The second line of input will contain ~N~ space separated integers, ~A_1, A_2 ... A_N~.
~1 \le M \le N \le 10^5~
Output on a single line, the number of good subarrays.
Sample Input 1
3 3 1 2 3
Sample Output 1
Sample Input 2
4 3 1 2 3 1
Sample Output 2