DZY has a hash table with p buckets, numbered from 0 to p - 1. He wants to insert n numbers, in the order they are given, into the hash table. For the i-th number xi, DZY will put it into the bucket numbered h(xi), where h(x) is the hash function. In this problem we will assume, that h(x) = x mod p. Operation a mod b denotes taking a remainder after division a by b.

However, each bucket can contain no more than one element. If DZY wants to insert an number into a bucket which is already filled, we say a "conflict" happens. Suppose the first conflict happens right after the i-th insertion, you should output i. If no conflict happens, just output -1.

Input

The first line contains two integers, p and n (2 ≤ p, n ≤ 300). Then n lines follow. The i-th of them contains an integer xi (0 ≤ xi ≤ 109).

Output

Output a single integer — the answer to the problem.

Examples

Input

10 5
0
21
53
41
53


Output

4


Input

5 5
0
1
2
3
4


Output

-1
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Scanner;
import java.util.function.Function;
import java.util.stream.Collectors;
public class _p000447A {
    static public void main(final String[] args) throws IOException {
        p000447A._main(args);
    }
//begin p000447A.java
static private class p000447A extends Solver{public p000447A(){nameIn="p000447A.in"
;singleTest=true;}int p;int n;int[]x;@Override protected void solve(){int[]hash=
new int[p];Arrays.fill(hash,-1);for(int i=0;i<n;i++){if(hash[x[i]% p]!=-1){pw.println
(i+1);return;}hash[x[i]% p]=1;}pw.println(-1);}@Override public void readInput()
throws IOException{p=sc.nextInt();n=sc.nextInt();if(sc.hasNextLine()){sc.nextLine
();}x=new int[n];for(int _ix=0;_ix<n;_ix++){x[_ix]=sc.nextInt();if(sc.hasNextLine
()){sc.nextLine();}}}static public void _main(String[]args)throws IOException{new
p000447A().run();}}
//end p000447A.java
//begin net/leksi/contest/Solver.java
static private abstract class Solver{protected String nameIn=null;protected String
nameOut=null;protected boolean singleTest=false;protected boolean preprocessDebug
=false;protected boolean doNotPreprocess=false;protected Scanner sc=null;protected
PrintWriter pw=null;private void process()throws IOException{if(!singleTest){int
t=lineToIntArray()[0];while(t-->0){readInput();solve();}}else{readInput();solve(
);}}abstract protected void readInput()throws IOException;abstract protected void
solve()throws IOException;protected int[]lineToIntArray()throws IOException{return
Arrays.stream(sc.nextLine().trim().split("\\s+")).mapToInt(Integer::valueOf).toArray
();}protected long[]lineToLongArray()throws IOException{return Arrays.stream(sc.nextLine
().trim().split("\\s+")).mapToLong(Long::valueOf).toArray();}protected String joinToString
(final int[]a){return Arrays.stream(a).mapToObj(Integer::toString).collect(Collectors
.joining(" "));}protected String joinToString(final long[]a){return Arrays.stream
(a).mapToObj(Long::toString).collect(Collectors.joining(" "));}protected<T>String
joinToString(final T[]a){return Arrays.stream(a).map(v->v.toString()).collect(Collectors
.joining(" "));}protected<T>String joinToString(final T[]a,final Function<T,String>
toString){return Arrays.stream(a).map(v->v.toString()).collect(Collectors.joining
(" "));}protected<T>String joinToString(final Collection<T>a){return a.stream().map
(v->v.toString()).collect(Collectors.joining(" "));}protected<T>String joinToString
(final Collection<T>a,final Function<T,String>toString){return a.stream().map(v->
toString.apply(v)).collect(Collectors.joining(" "));}protected List<Long>intArrayToLongList
(final int[]a){return Arrays.stream(a).mapToObj(Long::valueOf).collect(Collectors
.toList());}protected List<Integer>toList(final int[]a){return Arrays.stream(a).mapToObj
(Integer::valueOf).collect(Collectors.toList());}protected List<Long>toList(final
long[]a){return Arrays.stream(a).mapToObj(Long::valueOf).collect(Collectors.toList
());}protected void run()throws IOException{boolean done=false;if(nameIn !=null)
{try{try(FileInputStream fis=new FileInputStream(nameIn);PrintWriter pw0=select_output
();){done=true;sc=new Scanner(fis);pw=pw0;process();}}catch(IOException ex){}}if
(!done){try(PrintWriter pw0=select_output();){sc=new Scanner(System.in);pw=pw0;process
();}}}private PrintWriter select_output()throws FileNotFoundException{if(nameOut
!=null){return new PrintWriter(nameOut);}return new PrintWriter(System.out);}}
//end net/leksi/contest/Solver.java
}
