Maximum
Let's define a fragment of a numerical sequence as any non-empty contiguous subsequence of that sequence. For instance, in the sequence of numbers 1, 7, 3, the fragments include the entire sequence 1, 7, 3, the two-element subsequences 1, 7 and 7, 3 (but not the subsequence 1, 3), as well as the single-element subsequences 1, 7, and 3.
**Task**
Write a program that, given a sequence of numbers and a value M, calculates how many fragments of the sequence have a maximum value equal to M. Note that fragments with the same numbers but in different positions in the sequence are considered distinct.
**Input**
The first line of the input contains two natural numbers: N ((2 N 10^5)) — the length of the sequence — and M ((1 M 10^9)). The second line contains a sequence of N natural numbers, each not exceeding (10^9).
**Output**
The output should be a single number — the count of fragments in the sequence whose largest number is exactly M.
**Scoring**
The test set is divided into 3 blocks, with the following conditions:
1. 25 points: (2 N 100) 2. 25 points: (100 < N 1000) 3. 50 points: (1000 < N 10^5)