Unicycle counting

No attempts yetTime limit2sMemory limit256 MB

Problem

Life at circus college is less fun than the brochure promised. You are taking too many classes, the trapeze class goes up and then down, and the wire in the high wire class stays under tension.

The one thing you enjoy is riding unicycles with your classmates. The wheels come in different sizes, and every tire leaves one small mark on the ground per rotation. One day you look at the marks left on a road and decide to count, instead of doing homework, the smallest number of unicycles that could have left them.

A stretch of road is the set of positions 0,1,,m10, 1, \dots, m-1. A unicycle rides the whole road from the beginning to the end. Its wheel has an integer circumference c1c \ge 1, and the position ss of its first mark satisfies 0s<c0 \le s < c. So this unicycle leaves a mark at every position among s,s+c,s+2c,s, s+c, s+2c, \dots that is smaller than mm.

You observed every mark left on the road, so no unicycle leaves a mark at a position you did not observe. Two different unicycles can leave marks at the same position.

Given the length of the road and the observed positions, find the minimum number of unicycles that could have left those marks.

Input

Each line of input holds the observations for one stretch of road. A line begins with two integers mm and nn (1m1001 \le m \le 100, 1n101 \le n \le 10), where mm is the length of the road and nn is the number of observed marks. Then come nn distinct integers a1,a2,,ana_1, a_2, \dots, a_n (0ai<m0 \le a_i < m), the positions where a tire left a mark. The input holds at most 100 lines and ends at end of file.

Output

For each stretch of road, print on one line the minimum number of unicycles that could have produced the observed marks.