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
'''p=input().rstrip().split(' ')
if int(p[0])==1:
    for i in range(0,int(p[0])):
        g=input().rstrip()
    g=list(g);
    if g.count('W')==len(g):
        print(1)
    else:
        print(-1)
elif int(p[1])==1:
    l=[]
    for i in range(0,int(p[0])):
        g=input().rstrip()
        g=list(g);
        for j in range(0,len(g)):
            l.append(g[j])
    if l.count('W')==len(l):
        print(1)
    else:
        print(-1)
else:
    l=[]
    q=[]
    w=[]
    S=[]
    D=[]
    for i in range(0,int(p[0])):
        b=input().rstrip()
        b=list(b)
        q.append(b)
        for j in range(0,len(b)):
            l.append(b[j])
            if b[j]=='B':
                S.append(i)
                D.append(j)
    print(S)
    print(D)
    if l.count('W')==len(l):
        print(1)
    else:
        if len(set(S))==1:
            A=max(D)-min(D)+1
            if (S[0]+1)<A:
                print(-1)
            else:
                F=0;
                for i in range(S[0]-A+1,S[0]+1):
                    for j in range(min(D),max(D)+1):
                        if q[i][j]=='W':
                            F+=1;
                print(F)
        elif (max(S)+1)<
        elif (max(S)-min(S)+1)>int(p[1]):
            print(-1,1)
        elif (max(D)-min(D)+1)>(max(S)-min(S)+1):
            print(-1,2)
        else:
            A=max(S)
            B=min(S)
            F=0;
            G=max(D)-(max(S)-min(S))
            for i in range(B,A+1):
                for j in range(G,max(D)+1):
                    if q[i][j]=='W':
                        F+=1;
            print(F)'''


p=input().rstrip().split(' ')
P=int(p[0])
n=int(p[1])
l=[0]*1000000
G=-78978;
q=[]
for i in range(0,n):
    o=int(input())
    q.append(o)
for i in range(0,len(q)):
    t=int(q[i])%P
    if l[t]==0:
        l[t]=1;
    else:
        G=i;
        break;
if(G==-78978):
    print(-1)
else:
    print(G+1)
































