You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K.

a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K?

Constraints

* All input values are integers.
* 1 ≤ N ≤ 2 \times 10^5
* 1 ≤ K ≤ 10^9
* 1 ≤ a_i ≤ 10^9

Input

Input is given from Standard Input in the following format:


N K
a_1
a_2
:
a_N


Output

Print the number of the non-empty contiguous subsequences with an arithmetic mean that is greater than or equal to K.

Examples

Input

3 6
7
5
7


Output

5


Input

1 2
1


Output

0


Input

7 26
10
20
30
40
30
20
10


Output

13
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {

    static int N;
    static int K;
    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();
        K = sc.nextInt();
        A = sc.nextIntArray(N);
        System.out.println(solve());
    }

    static long solve() {
        long[] S = new long[N+1];
        S[0] = 0;
        for (int i = 1; i < N+1; i++) {
            S[i] = (A[i-1] - K) + S[i-1];
        }

        long[] T = Arrays.copyOf(S, N+1);
        Arrays.sort(T);
        int id = 1;
        Map<Long, Integer> map = new HashMap<>();

        long prev = T[0];
        map.put(prev, id);
        id++;
        for (int i = 1; i < N+1; i++) {
            long t = T[i];
            if( t == prev ) continue;

            map.put(t, id);
            prev = t;
            id++;
        }

        int[] C = new int[N+1];
        for (int i = 0; i < N+1; i++) {
            C[i] = map.get(S[i]);
        }

        long ans = 0;
        BinaryIndexedTree bit = new BinaryIndexedTree(N+1);
        for (int i = 0; i < N+1; i++) {
            ans += bit.sum(C[i]);
            bit.add(C[i], 1);
        }

        return ans;
    }

    static class BinaryIndexedTree {
        int n;
        int[] bit;

        BinaryIndexedTree(int n) {
            this.n = n;
            bit = new int[n+1];
        }

        void add(int i, int x) {
            while( i <= n ) {
                bit[i] += x;
                i += (i & -i);
            }
        }

        int sum(int i) {
            int ret = 0;
            while( i > 0 ) {
                ret += bit[i];
                i -= (i & -i);
            }
            return ret;
        }
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}
