Petya has an array a consisting of n integers. He has learned partial sums recently, and now he can calculate the sum of elements on any segment of the array really fast. The segment is a non-empty sequence of elements standing one next to another in the array.

Now he wonders what is the number of segments in his array with the sum less than t. Help Petya to calculate this number.

More formally, you are required to calculate the number of pairs l, r (l ≤ r) such that a_l + a_{l+1} + ... + a_{r-1} + a_r < t.

Input

The first line contains two integers n and t (1 ≤ n ≤ 200 000, |t| ≤ 2⋅10^{14}).

The second line contains a sequence of integers a_1, a_2, ..., a_n (|a_{i}| ≤ 10^{9}) — the description of Petya's array. Note that there might be negative, zero and positive elements.

Output

Print the number of segments in Petya's array with the sum of elements less than t.

Examples

Input

5 4
5 -1 3 4 -1


Output

5


Input

3 0
-1 2 -3


Output

4


Input

4 -1
-2 1 -2 3


Output

3

Note

In the first example the following segments have sum less than 4:

  * [2, 2], sum of elements is -1 
  * [2, 3], sum of elements is 2 
  * [3, 3], sum of elements is 3 
  * [4, 5], sum of elements is 3 
  * [5, 5], sum of elements is -1 
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Queue;
import java.util.HashSet;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution {
    boolean eof;
    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    public static void main(String[] args) throws IOException {
        new Solution().run();
    }

    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "-1";
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }


    void run() throws IOException {
        InputStream input = System.in;
        PrintStream output = System.out;
        String name = "a";
        try {
            File f = new File(name + ".in");
            if (f.exists() && f.canRead()) {
                input = new FileInputStream(f);
                output = new PrintStream(name + ".out");
            }
        } catch (Throwable e) {
        }
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        solve();
        br.close();
        out.close();
    }

    final Random RNG = new Random();

    class Node<K> {
        K key;
        int priority;
        int size;
        Node<K> l;
        Node<K> r;

        public Node(K k) {
            priority = RNG.nextInt();
            this.key = k;
            size = 1;
        }
    }

    class MySetGen<K extends Comparable<K>> {


        Node<K> root;

        void add(K e) {
            if (contains(e)) {
                return;
            }
            Node<K>[] t = split(root, e);
            root = merge(t[0], new Node<K>(e));
            root = merge(root, t[1]);
        }

        void remove(K e) {
            if (!contains(e)) {
                return;
            }
            root = remove(root, e);
        }

        private Node<K> max(Node<K> v) {
            while (v.r != null) {
                v = v.r;
            }
            return v;
        }

        private Node<K> min(Node<K> v) {
            while (v.l != null) {
                v = v.l;
            }
            return v;
        }

        private Node<K> getLower(Node<K> v, K e) {
            if (v == null) {
                return null;
            }
            int comp = v.key.compareTo(e);
            if (comp == 0) {
                if (v.l == null) {
                    return null;
                }
                return max(v.l);
            }
            if (comp < 0) {
                Node<K> got = getLower(v.r, e);
                if (got == null) {
                    return v;
                } else {
                    return got;
                }
            } else {
                return getLower(v.l, e);
            }
        }

        private Node<K> getHigher(Node<K> v, K e) {
            if (v == null) {
                return null;
            }
            int comp = v.key.compareTo(e);
            if (comp == 0) {
                if (v.r == null) {
                    return null;
                }
                return min(v.r);
            }
            if (comp < 0) {
                return getHigher(v.r, e);
            } else {
                Node<K> got = getHigher(v.l, e);
                if (got == null) {
                    return v;
                } else {
                    return got;
                }
            }
        }

        K lower(K e) {
            Node<K> got = getLower(root, e);
            return got == null ? null : got.key;
        }

        K higher(K e) {
            Node<K> got = getHigher(root, e);
            return got == null ? null : got.key;
        }

        K ceiling(K e) {
            Node<K> got = get(root, e);
            if (got != null) {
                System.err.println("YER");
                return got.key;
            }
            return higher(e);
        }

        K floor(K e) {
            Node<K> got = get(root, e);
            if (got != null) {
                return got.key;
            }
            return lower(e);
        }

        private Node<K> remove(Node<K> v, K e) {
            if (v == null) {
                return null;
            }
            if (v.key.compareTo(e) == 0) {
                return merge(v.l, v.r);
            }
            if (v.key.compareTo(e) < 0) {
                v.size--;
                v.r = remove(v.r, e);
            } else {
                v.size--;
                v.l = remove(v.l, e);
            }
            return v;
        }

        private Node<K> merge(Node<K> l, Node<K> r) {
            if (l == null) {
                return r;
            }
            if (r == null) {
                return l;
            }
            Node<K> ret;
            if (l.priority > r.priority) {
                l.r = merge(l.r, r);
                ret = l;
            } else {
                r.l = merge(l, r.l);
                ret = r;
            }
            ret.size = 1;
            if (ret.l != null) {
                ret.size += ret.l.size;
            }
            if (ret.r != null) {
                ret.size += ret.r.size;
            }
            return ret;
        }

        private Node<K>[] split(Node<K> v, K e) {
            if (v == null) {
                return new Node[2];
            }
            Node<K>[] t;
            if (v.key.compareTo(e) <= 0) {
                t = split(v.r, e);
                v.r = t[0];
                v.size = 1;
                if (v.l != null) {
                    v.size += v.l.size;
                }
                if (v.r != null) {
                    v.size += v.r.size;
                }
                t[0] = v;
            } else {
                t = split(v.l, e);
                v.l = t[1];
                v.size = 1;
                if (v.l != null) {
                    v.size += v.l.size;
                }
                if (v.r != null) {
                    v.size += v.r.size;
                }
                t[1] = v;
            }
            return t;
        }

        private Node<K> get(Node<K> v, K e) {
            if (v == null) {
                return null;
            }
            int comp = v.key.compareTo(e);
            if (comp == 0) {
                return v;
            } else if (comp < 0) {
                return get(v.r, e);
            } else {
                return get(v.l, e);
            }
        }

        boolean contains(K e) {
            return get(root, e) != null;
        }

    }

    class Pair implements Comparable<Pair> {
        long len;
        int id;

        public Pair(long len, int id) {
            this.len = len;
            this.id = id;
        }

        @Override
        public int compareTo(Pair o) {
            if (id == o.id)
                return 0;
            else {
                int x = Long.compare(len, o.len);
                if (x == 0)
                    return Integer.compare(id, o.id);
                else
                    return x;
            }
        }
    }

    void solve() {
        int n = nextInt();
        long t = nextLong();
        long[] a= new long[n];
        long[] p= new long[n];
        long ans = 0;
        for (int i = 0; i < n; i++) {
            a[i] = nextLong();
            if (a[i] < t)
                ans++;
        }
        long cs = a[0];
        MySetGen<Pair> set = new MySetGen<>();

        for (int i = 1; i < n; i++) {
            cs += a[i];
            p[i] = cs;
            set.add(new Pair(cs, i));
        }
        for (int i = 0; i < n - 1; i++) {
            Node<Pair>[] ll = set.split(set.root, new Pair(t, -1));
            if (ll[0] != null) {
                ans += ll[0].size;
            }

            set.root = set.merge(ll[0], ll[1]);
            set.remove(new Pair(p[i + 1], i + 1));
            t += a[i];
        }
        out.println(ans);
    }
}



