Long Binary Sequence

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Bobo has a very very long binary sequence ss of length nn. All except mm positions x_1,x_2,,x_mx\_1, x\_2, \dots, x\_m are 00 (And s_x_1=s_x_2==s_x_m=1s\_{x\_1} = s\_{x\_2} = \dots = s\_{x\_m} = 1).

Now bobo would like to know the number of distinct consecutive substrings of ss.

입력

The first line contains 22 integers n,mn, m (1n109,1mminn,10001 \leq n \leq 10^9, 1 \leq m \leq \min\\{n, 1000\\}).

The second line contains mm integers x_1,x_2,,x_mx\_1, x\_2, \dots, x\_m (1x_1<x_2<<x_mn1 \leq x\_1 < x\_2 < \dots < x\_m \leq n).

출력

A single integer denotes the number of distinct substrings.