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 
# https://tjkendev.github.io/procon-library/python/range_query/rsq_ruq_segment_tree_lp.html
class segmentTree():
    initValue = 0
    dat = []
    lenTreeLeaf = -1
    depthTreeList = 0
    lenOriginalList = -1
    func = None
    funcPropagateToChild = None
    lazy = None
    N = -1

    def load(self, l):
        self.N = len(l)
        self.lenOriginalList = self.N  # original nodes
        self.depthTreeList = (self.N - 1).bit_length()  # Level of Tree
        self.lenTreeLeaf = 2 ** self.depthTreeList  # leaf of node, len 5 -> 2^3 = 8
        self.dat = [self.initValue] * (self.lenTreeLeaf * 2)
        self.lazy = [self.initValue] * (self.lenTreeLeaf * 2)  # lazy propagete buffer

        # Load Function
        for i in range(len(l)):
            self.dat[self.lenTreeLeaf - 1 + i] = l[i]
        self.build()

    def build(self):
        for i in range(self.lenTreeLeaf - 2, -1, -1):
            self.dat[i] = self.func(self.dat[2 * i + 1], self.dat[2 * i + 2])
            # print("build: node", i, "child is ", self.dat[2 * i + 1], self.dat[2 * i + 2] ,"then I am ", self.dat[i])

    # just wrapper, get node value and op and put it
    def addValue(self, ind, value):
        nodeId = (self.lenTreeLeaf - 1) + ind
        self.dat[nodeId] += value
        self.setValue(ind, self.dat[nodeId])

    # set value to node, recalc parents NODEs
    def setValue(self, ind, value):
        nodeId = (self.lenTreeLeaf - 1) + ind
        self.dat[nodeId] = value
        while nodeId != 0:
            nodeId = (nodeId - 1) // 2
            self.dat[nodeId] = self.func(self.dat[nodeId * 2 + 1], self.dat[nodeId * 2 + 2])

    def nodelistFromLR(self, l, r, withchild=False):
        L = (l + self.lenTreeLeaf) >> 1
        R = (r + self.lenTreeLeaf) >> 1

        lc = 0 if l & 1 else (L & -L).bit_length()
        rc = 0 if r & 1 else (R & -R).bit_length()

        res = []
        for i in range(self.depthTreeList + (1 if withchild else 0)):
            if rc <= i:
                res.append(R - 1)
            if L < R and lc <= i:
                res.append(L - 1)
            L = L >> 1
            R = R >> 1
        return res

    def rangeAdd(self, l, r, x):
        plist = self.nodelistFromLR(l, r)
        self.propagete(plist)

        L = self.lenTreeLeaf + l
        R = self.lenTreeLeaf + r
        # print(">>before", self.lazy, L, R)
        value = x
        while L < R:
            if R & 1:
                R -= 1
                # print(">>> updateR", R-1, value)
                self.lazy[R - 1] = self.func(self.lazy[R - 1], value)
                self.dat[R - 1] = self.func(self.dat[R - 1], value)
            if L & 1:
                # print(">>> updateL", L-1, value)
                self.lazy[L - 1] = self.func(self.lazy[L - 1], value)
                self.dat[L - 1] = self.func(self.dat[L - 1], value)
                L += 1
            L = L >> 1
            R = R >> 1
            value = self.funcRangePropagetToParent(value)
            # print(">>>END cur", L, R)
        # print(">>after", self.lazy)

        for node in plist:
            self.dat[node] = self.func(self.dat[2 * node + 1], self.dat[2 * node + 2])

    def propagete(self, plist):
        for nodeId in plist[::-1]:
            " this function will be call from top to down"
            # print("propagete", nodeId, "curlazyval =", self.lazy[nodeId])
            if self.lazy[nodeId] == self.initValue:
                continue
            if nodeId < (self.lenTreeLeaf - 1):  # if this node has childs
                propageteValue = self.funcPropagateToChild(self.lazy[nodeId])
                # print(" > propagate to node")
                self.lazy[2 * nodeId + 1] = self.func(self.lazy[2 * nodeId + 1], propageteValue)
                self.lazy[2 * nodeId + 2] = self.func(self.lazy[2 * nodeId + 2], propageteValue)
                self.dat[2 * nodeId + 1] = self.func(self.dat[2 * nodeId + 1], propageteValue)
                self.dat[2 * nodeId + 2] = self.func(self.dat[2 * nodeId + 2], propageteValue)
            else:
                # print(" > do nothing")
                pass
            # Feedback to myself value
            # self.dat[nodeId] = self.func(self.dat[nodeId], self.lazy[nodeId])
            self.lazy[nodeId] = self.initValue

    def query(self, l, r):
        # print("query()", l, r)
        plist = self.nodelistFromLR(l, r)
        self.propagete(plist)

        L = self.lenTreeLeaf + l
        R = self.lenTreeLeaf + r

        view = []
        res = self.initValue
        while L < R:
            if R & 1:
                R -= 1
                # print(">>>checkR", R-1, "value", self.dat[R-1])
                res = self.func(res, self.dat[R - 1])
            if L & 1:
                # print(">>>checkL", L-1, "value", self.dat[L-1])
                res = self.func(res, self.dat[L - 1])
                L += 1
            L = L >> 1
            R = R >> 1
        return res

    def findNthValueSub(self, x, nodeId):
        """
        [2, 3, 5, 7] = [0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0]
        とマッピングされているセグメント木においてx番目に小さい値を得るための関数
        """
        if self.dat[nodeId] < x:  # このノードが要求されているよりも小さい値しか持たないとき
            return (None, x - self.dat[nodeId])
        if nodeId >= self.lenTreeLeaf - 1:  # nodeIfがノードのときは
            return (True, nodeId - (self.lenTreeLeaf - 1))  # そのindex番号を返す
        resLeft = self.findNthValueSub(x, 2 * nodeId + 1)  # 左側の探索を行う
        if resLeft[0] != None:  # もし、値が入っているならそれを返す
            return (True, resLeft[1])
        resRight = self.findNthValueSub(resLeft[1], 2 * nodeId + 2)  # 右側の探索を行う
        return resRight

    def findNthValue(self, x):
        return self.findNthValueSub(x, 0)[1]

class segmentTreeSum(segmentTree):
    def __init__(self):
        self.func = lambda x, y: x + y
        self.funcPropagateToChild = lambda parentValue: parentValue >> 1
        self.funcRangePropagetToParent = lambda currentValue: currentValue << 1
        self.initValue = 0

class segmentTreeMin(segmentTree):
    def __init__(self):
        self.func = lambda x, y: min(x, y)
        self.funcPropagateToChild = lambda parentValue: parentValue
        self.funcRangePropagetToParent = lambda currentValue: currentValue
        self.initValue = 2 * 10 ** 9

import sys

import sys
#input = sys.stdin.readline
def do():
    st = segmentTreeSum()
    n, t = map(int, input().split())
    dat = list(map(int, input().split()))
    dattotal = []
    total = 0
    segtreeList = [0] * (200000 + 10)
    zatsu = set()
    for x in dat:
        total += x
        dattotal.append(total)
        zatsu.add(total)
    zatsu = list(zatsu)
    zatsu.sort()
    zatsuTable = dict()
    zatsuTableRev = dict()
    for ind, val in enumerate(zatsu):
        zatsuTable[val] = ind
        zatsuTableRev[ind] = val
    buf = []
    for x in dattotal:
        buf.append(zatsuTable[x])
        segtreeList[zatsuTable[x]] += 1
    st.load(segtreeList)
    #print(segtreeList[:10])

    from bisect import bisect_left, bisect_right

    offset = 0
    res = 0
    #print(zatsu)
    for i in range(n): # x = total from 0 to curren
        #print("---------, i")
        x = dattotal[i]
        curvalind = zatsuTable[x]
        targetval = t + offset# target val
        targetind = bisect_left(zatsu, targetval)
        cnt = st.query(0, targetind )
        #print(i, "offset", offset, "query",curvalind, targetind+1)
        #print(segtreeList[:10])
        #print(x, "target=", targetval, "targetind", targetind, "cnt = ", cnt)
        res += cnt
        #print("cur", st.query(curvalind, curvalind+1), curvalind)
        st.addValue(curvalind, -1)
        #print("cur", st.query(curvalind, curvalind+1))
        offset += dat[i] # for next offset
    print(res)


do()