#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)

int n;
ll k;
ll a[252521];

ll s[125252];

ll solve(int l,int r){
  if(r-l==1){
    return (ll)(a[l]>=0);
  }
  int mid = (l+r)/2;
  // divide
  ll ret = solve(l,mid) + solve(mid,r);
  // merge
  int lena = mid-l;
  int lenb = r-mid;
  // 片方を列挙
  ll yo = 0;
  REP(i,lenb){
    yo += a[mid+i];
    s[i] = yo;
  }
  // ソート
  sort(s,s+lenb);
  // もう片方を1つ1つ試して二分探索
  yo = 0;
  REP(i,lena){
    yo += a[mid-1-i];
    int x = lower_bound(s,s+lenb,-yo) - s;
    ret += lenb-x;
  }
  return ret;
}

int main(){
  scanf("%d%lld",&n,&k);
  REP(i,n)scanf("%lld",a+i);
  REP(i,n)a[i] -= k;
  ll ans = solve(0,n);
  printf("%lld\n",ans);
  return 0;
}
