#include <bits/stdc++.h>
using namespace std;
int num[111111], res1[111111 * 3], res2[111111 * 3];
int main() {
  int n, m, add1 = 0, addn = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i < m + 1; i++) scanf("%d", &num[i]);
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i < n + 1; i++) res1[i + m] = res2[i + m] = 1;
  int pos1 = m, pos2 = m;
  for (int i = 1; i < m + 1; i++) {
    pos1--, pos2++;
    res1[pos1 + num[i] - 1] += res1[pos1 + num[i]], res1[pos1 + num[i]] = 0;
    res2[pos2 + num[i] + 1] += res2[pos2 + num[i]], res2[pos2 + num[i]] = 0;
  }
  pos1--, pos2++;
  long long res = n;
  for (int i = 0; i < 3 * max(n, m) + 1; i++)
    res += min(n, i - pos1) * 1ll * res1[i];
  for (int i = 0; i < 3 * max(n, m) + 1; i++)
    res -= max(1, i - pos2) * 1ll * res2[i];
  printf("%I64d\n", res);
}
