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.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class CF1042D {

    public static void main(String[] args) {
        FastReader reader = new FastReader();
        int n = reader.nextInt();
        long t = reader.nextLong();

        // S[C] - S[x] < t => -S[x] < t - S[C]
        AVLTree<Long, Long> tree = new AVLTree<>();
        tree.insert(0L, 0L);
        long result = 0;
        long current = 0;
        for (int i = 0; i < n; i++) {
            int v = reader.nextInt();
            current += v;

            result += tree.order(t - current - 1);

            tree.insert(-1 * current, current);
        }

        System.out.println(result);
    }


    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class AVLTree<K extends Comparable<K>, V> {

        static class Node<K extends Comparable<K>, V> implements Comparable<Node<K, V>> {
            K key;
            long index;
            V value;
            int size = 1;
            int depth;

            Node(K key, V value, long index) {
                this.key = key;
                this.value = value;
                this.index = index;
            }

            Node<K, V> left;
            Node<K, V> right;
            Node<K, V> parent;

            public int compareTo(Node<K, V> o) {
                int keyCompare = key.compareTo(o.key);
                if (keyCompare != 0) return keyCompare;
                return Long.compare(index, o.index);
            }

            void print(StringBuilder sb, String line) {
                sb.append(line).append(" ")
                        .append(key)
                        .append(" (")
                        .append(parent != null ? parent.key : "root")
                        .append(":")
                        .append(depth)
                        .append(":")
                        .append(size)
                        .append(")").append('\n');
                int indent = line.length() + 1;

                StringBuilder newLine = new StringBuilder(indent);
                for (int i = 0; i < indent; i++) {
                    newLine.append(' ');
                }

                if (left != null) {
                    left.print(sb, newLine.toString() + "l: ->");
                }
                if (right != null) {
                    right.print(sb, newLine.toString() + "r: ->");
                }
            }

            @Override
            public String toString() {
                return "Node{" +
                        "key=" + key +
                        '}';
            }
        }

        Node<K, V> root;
        private long logIndex = 0;

        public void insert(K key, V value) {
            Node<K, V> current = root;
            Node<K, V> newNode = new Node<>(key, value, logIndex++);
            if (current == null) {
                this.root = newNode;
                this.root.depth = 1;
                return;
            }
            while (true) {
                Node<K, V> next;
                if (current.compareTo(newNode) <= 0) {
                    next = current.right;
                    if (next == null) {
                        current.right = new Node<>(key, value, logIndex++);
                        current.right.depth = 1;
                        current.right.parent = current;
                        break;
                    }
                } else {
                    next = current.left;
                    if (next == null) {
                        current.left = new Node<>(key, value, logIndex++);
                        current.left.depth = 1;
                        current.left.parent = current;
                        break;
                    }
                }
                current = next;
            }

            fixBalanceToRoot(current);
        }

        public Node<K, V> delete(K key) {
            Node<K, V> expected = findLower(new Node<K, V>(key, null, Long.MAX_VALUE));
            if (expected == null || expected.key.compareTo(key) != 0) return null;
            return deleteNode(expected);
        }

        public V find(K key) {
            Node<K, V> expected = findLower(new Node<K, V>(key, null, Long.MAX_VALUE));
            if (expected == null || expected.key.compareTo(key) != 0) return null;

            return expected.value;
        }

        public int order(K key) {
            return order(new Node<K, V>(key, null, Long.MAX_VALUE));
        }

        private void fixBalanceToRoot(Node<K, V> current) {
            while (current != null) {
                Node<K, V> parent = current.parent;
                Node<K, V> newRoot = fixBalance(current);
                if (parent != null) {
                    if (parent.right == current) {
                        parent.right = newRoot;
                    } else {
                        parent.left = newRoot;
                    }
                } else {
                    root = newRoot;
                }
                current = parent;
            }
        }

        private Node<K, V> deleteNode(Node<K, V> current) {
            if (current.left == null && current.right == null) {
                if (current.parent == null) {
                    root = null;
                } else {
                    if (current.parent.left == current) {
                        current.parent.left = null;
                    } else {
                        current.parent.right = null;
                    }
                    rebalance(current.parent);
                }
                fixBalanceToRoot(current.parent);
            } else {
                if (current.left != null) {
                    Node<K, V> nextLower = findLower(current);
                    nextLower = deleteNode(nextLower);

                    nextLower.left = current.left;
                    if (nextLower.left != null) nextLower.left.parent = nextLower;
                    nextLower.right = current.right;
                    if (nextLower.right != null) nextLower.right.parent = nextLower;
                    rebalance(nextLower);
                    if (current.parent == null) {
                        root = nextLower;
                        nextLower.parent = null;
                    } else {
                        if (current.parent.left == current) {
                            current.parent.left = nextLower;
                        } else {
                            current.parent.right = nextLower;
                        }
                        nextLower.parent = current.parent;
                    }
                } else {
                    if (current.parent == null) {
                        root = current.right;
                        current.right.parent = null;
                    } else {
                        if (current.parent.left == current) {
                            current.parent.left = current.right;
                        } else {
                            current.parent.right = current.right;
                        }
                        current.right.parent = current.parent;
                    }
                    fixBalanceToRoot(current.right.parent);
                }
            }
            return current;
        }

        private Node<K, V> findLower(Node<K, V> findNode) {
            Node<K, V> prev = null;
            Node<K, V> current = root;

            while (current != null) {
                int compare = current.compareTo(findNode);
                if (compare < 0) {
                    prev = current;
                    current = current.right;
                } else {
                    current = current.left;
                }
            }

            return prev;
        }

        private int order(Node<K, V> findNode) {
            Node<K, V> current = root;

            int count = 0;
            while (current != null) {
                int compare = current.compareTo(findNode);
                if (compare < 0) {
                    if (current.left != null) {
                        count += current.left.size;
                    }
                    count++;
                    current = current.right;
                } else {
                    current = current.left;
                }
            }

            return count;
        }

        private void rebalance(Node<K, V> current) {
            current.depth = Math.max((current.right == null ? 0 : current.right.depth),
                    (current.left == null ? 0 : current.left.depth)) + 1;
            current.size = (current.right == null ? 0 : current.right.size) +
                    (current.left == null ? 0 : current.left.size) + 1;
        }

        private Node<K, V> rotateLeft(Node<K, V> current) {
            Node<K, V> parent = current.parent;
            Node<K, V> right = current.right;
            Node<K, V> rightLeft = right.left;

            current.right = rightLeft;
            if (rightLeft != null) rightLeft.parent = current;

            right.left = current;
            current.parent = right;
            right.parent = parent;

            rebalance(current);
            rebalance(right);

            return right;
        }

        private Node<K, V> rotateRight(Node<K, V> current) {
            Node<K, V> parent = current.parent;
            Node<K, V> left = current.left;
            Node<K, V> leftRight = left.right;

            current.left = leftRight;
            if (leftRight != null) leftRight.parent = current;

            left.right = current;
            current.parent = left;
            left.parent = parent;

            rebalance(current);
            rebalance(left);

            return left;
        }

        private Node<K, V> rotateLeftLarge(Node<K, V> current) {
            Node<K, V> parent = current.parent;
            Node<K, V> right = current.right;
            Node<K, V> rightLeft = right.left;
            Node<K, V> rightLeftRight = right.left.right;
            Node<K, V> rightLeftLeft = right.left.left;

            current.right = rightLeftLeft;
            if (rightLeftLeft != null) rightLeftLeft.parent = current;

            right.left = rightLeftRight;
            if (rightLeftRight != null) rightLeftRight.parent = right;

            rightLeft.left = current;
            rightLeft.right = right;
            current.parent = rightLeft;
            right.parent = rightLeft;
            rightLeft.parent = parent;

            rebalance(current);
            rebalance(right);
            rebalance(rightLeft);

            return rightLeft;
        }

        private Node<K, V> rotateRightLarge(Node<K, V> current) {
            Node<K, V> parent = current.parent;
            Node<K, V> left = current.left;
            Node<K, V> leftRight = left.right;
            Node<K, V> leftRightLeft = left.right.left;
            Node<K, V> leftRightRight = left.right.right;

            current.left = leftRightRight;
            if (leftRightRight != null) leftRightRight.parent = current;

            left.right = leftRightLeft;
            if (leftRightLeft != null) leftRightLeft.parent = left;

            leftRight.right = current;
            leftRight.left = left;
            current.parent = leftRight;
            left.parent = leftRight;
            leftRight.parent = parent;

            rebalance(current);
            rebalance(left);
            rebalance(leftRight);

            return leftRight;
        }

        private int getDepth(Node<K, V> current) {
            return current == null ? 0 : current.depth;
        }

        private Node<K, V> fixBalance(Node<K, V> current) {
            if (current.left == null && current.right == null) {
                return current;
            }

            int rightDepth = getDepth(current.right);
            int leftDepth = getDepth(current.left);
            int diff = rightDepth - leftDepth;
            if (Math.abs(diff) <= 1) {
                rebalance(current);
                return current;
            }

            if (diff == -2) { // left deeper
                int leftLeftDepth = getDepth(current.left.left);
                int leftRightDepth = getDepth(current.left.right);
                if (leftLeftDepth >= leftRightDepth) {
                    return rotateRight(current);
                } else {
                    return rotateRightLarge(current);
                }
            } else if (diff == 2) { // right deeper
                int rightRightDepth = getDepth(current.right.right);
                int rightLeftDepth = getDepth(current.right.left);
                if (rightRightDepth >= rightLeftDepth) {
                    return rotateLeft(current);
                } else {
                    return rotateLeftLarge(current);
                }
            } else {
                throw new RuntimeException("Unexpected state");
            }
        }

        public int size() {
            return root == null ? 0 : root.size;
        }

        @Override
        public String toString() {

            StringBuilder sb = new StringBuilder();
            if (root != null) {
                root.print(sb, "");
            }

            return sb.toString();
        }
    }

}