function main(input) {
  // 入力値（文字列）を改行で区切る
  const inputList = input.split(/\n/);
  const oneLine = inputList[0];
  const twoLine = inputList[1];
  
  // はねた回数と指定値
  const oneLineInfo = oneLine.split(/\s/);
  const numOfJump = oneLineInfo[0];
  const value = formatNum(oneLineInfo[1]);

  // 
  const twoLineInfo = twoLine.split(/\s/);
  const lengthList = twoLineInfo.map(tl => formatNum(tl));
  lengthList.unshift(0);
  
  var count = 0;
  var result = 0;
  
  for (var i = 0; i < lengthList.length; i++) {
    result += lengthList[i];
    if (result <= value) {
      count++;
    }
  }
  console.log(count);
};

// 文字列を数値に変換
function formatNum(str) {
  return Number(str);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
