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,…,m−1. A unicycle rides the whole road from the beginning to the end. Its wheel has an integer circumference c≥1, and the position s of its first mark satisfies 0≤s<c. So this unicycle leaves a mark at every position among s,s+c,s+2c,… that is smaller than m.
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.
Each line of input holds the observations for one stretch of road. A line begins with two integers m and n (1≤m≤100, 1≤n≤10), where m is the length of the road and n is the number of observed marks. Then come n distinct integers a1,a2,…,an (0≤ai<m), the positions where a tire left a mark. The input holds at most 100 lines and ends at end of file.
For each stretch of road, print on one line the minimum number of unicycles that could have produced the observed marks.