#C6022. Regular Feeding Schedule
Regular Feeding Schedule
Regular Feeding Schedule
You are given the feeding schedule of some animals. In each test case, a schedule is provided as an interval K (in hours) and a series of feeding times (in hours). The schedule is considered regular if for every successive pair of feeding times, the difference is exactly K (i.e. \(t_i - t_{i-1} = K\) for all valid i). Note that if there is only one feeding time in the schedule, it is automatically considered regular.
Your task is to determine whether each schedule is regular or not.
inputFormat
The input begins with an integer T on the first line representing the number of test cases. Each test case consists of two lines:
- The first line contains two space-separated integers: K and N, where K is the feeding interval and N is the number of feeding times.
- The second line contains N space-separated integers representing the feeding times in increasing order.
outputFormat
For each test case, output a single line containing "YES" if the schedule is regular, or "NO" otherwise.
## sample1
4 5
0 4 8 12 16
YES
</p>