import java.util.*; import java.io.*; class no5 { public static void main(String args[])throws IOException { BufferedReader sc=new BufferedReader(new InputStreamReader(System.in)); int l=Integer.parseInt(sc.readLine()); int n=Integer.parseInt(sc.readLine()); String w[]=sc.readLine().split(" "); int wi[]=new int[n]; for(int i=0;i=wi[i]) { s-=wi[i]; ans++; } else break; //System.out.println(s); i++; }while(s>=0&&i