import java.util.Scanner;

class Main{
  public static int temp = 0;
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int X = sc.nextInt();
    int L[] = new int[N];
    for(int i = 0; i < N;i++){
     L[i] = sc.nextInt();
    }
    N = N + 1;
    
    int ans = 0;
    if(0 <= X){
      ans = ans + 1;
     }
    for(int i = 2; i <= N;i++){
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    }
    System.out.println(ans);

  }
  static int method(int Ni,int Li){
    return (temp + Li);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static int temp = 0;
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int X = sc.nextInt();
    int L[] = new int[N];
    for(int i = 0; i < N;i++){
     L[i] = sc.nextInt();
    }
    N = N + 1;
    
    int ans = 0;
    if(0 <= X){
      ans = ans + 1;
     }
    for(int i = 2; i <= N;i++){
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    }
    System.out.println(ans);

  }
  static int method(int Ni,int Li){
    return (temp + Li);
  }
} Main public static int temp = 0; temp 0 public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int X = sc.nextInt();
    int L[] = new int[N];
    for(int i = 0; i < N;i++){
     L[i] = sc.nextInt();
    }
    N = N + 1;
    
    int ans = 0;
    if(0 <= X){
      ans = ans + 1;
     }
    for(int i = 2; i <= N;i++){
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    }
    System.out.println(ans);

  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int X = sc.nextInt();
    int L[] = new int[N];
    for(int i = 0; i < N;i++){
     L[i] = sc.nextInt();
    }
    N = N + 1;
    
    int ans = 0;
    if(0 <= X){
      ans = ans + 1;
     }
    for(int i = 2; i <= N;i++){
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    }
    System.out.println(ans);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int L[] = new int[N]; L new int[N] N for(int i = 0; i < N;i++){
     L[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
     L[i] = sc.nextInt();
    } {
     L[i] = sc.nextInt();
    } L[i] = sc.nextInt() L[i] L i sc.nextInt() sc.nextInt sc N = N + 1 N N + 1 N 1 int ans = 0; ans 0 if(0 <= X){
      ans = ans + 1;
     } 0 <= X 0 X {
      ans = ans + 1;
     } ans = ans + 1 ans ans + 1 ans 1 for(int i = 2; i <= N;i++){
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    } int i = 2; int i = 2; i 2 i <= N i N i++ i++ i {
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    } {
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    } temp = method(i,L[i-2]) temp method(i,L[i-2]) method i L[i-2] L i-2 i 2 if(temp <= X){
      ans = ans + 1;
     } temp <= X temp X {
      ans = ans + 1;
     } ans = ans + 1 ans ans + 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int method(int Ni,int Li){
    return (temp + Li);
  } method {
    return (temp + Li);
  } return (temp + Li); (temp + Li) temp Li int Ni Ni int Li Li
import java.util.Scanner;

class Main{
  public static int temp = 0;
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int X = sc.nextInt();
    int L[] = new int[N];
    for(int i = 0; i < N;i++){
     L[i] = sc.nextInt();
    }
    N = N + 1;
    
    int ans = 0;
    if(0 <= X){
      ans = ans + 1;
     }
    for(int i = 2; i <= N;i++){
     temp = method(i,L[i-2]);
     if(temp <= X){
      ans = ans + 1;
     }
    }
    System.out.println(ans);

  }
  static int method(int Ni,int Li){
    return (temp + Li);
  }
}