A circle is divided into $$$K$$$ points which are numbered clockwise as $$$1, 2, \cdots, K$$$. Among them, markets $$$M_1, M_2, \cdots, M_n$$$ are built at points $$$a_1, a_2, \cdots, a_n$$$ respectively.
A trade route from market $$$i$$$ to market $$$j$$$ is a directed line segment $$$M_i M_j$$$ ($$$i \neq j$$$) and must satisfy the following conditions:
What is the maximum number of trade routes that can exist?
The first line contains two integers $$$K$$$, $$$n$$$ ($$$3 \leq K \leq 10^9, 3\leq n \leq \min(K,10^5) $$$), separated by a space, representing that there are $$$n$$$ markets distributed at the $$$K$$$ equally spaced points on the circle.
The second line contains $$$n$$$ integers $$$a_1, a_2, \cdots, a_n$$$ ($$$1\leq a_1 \lt a_2 \lt \cdots \lt a_{n-1} \lt a_n \leq K$$$), correspond to points at which a market is built.
Output an integer representing the maximum number of trade routes that can exist.
10 51 2 5 6 8
2
3 31 2 3
3
For the first example, the two possible answers are shown in the following figures:

