#include <bits/stdc++.h>
using namespace std;
int pool[1000005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a[100005];
  int *cnt = pool + 500000;
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  long long ans = n;
  for (int i = 1; i <= n; i++) {
    cnt[i] = 1;
  }
  for (int i = 0; i < m; i++) {
    ans += n;
    ans -= cnt[n - i];
    cnt[n - i - 1] += cnt[n - i];
    cnt[n - i] = 0;
    ans -= cnt[a[i] - i - 1];
    cnt[a[i] - i - 2] += cnt[a[i] - i - 1];
    cnt[a[i] - i - 1] = 0;
  }
  ans += n;
  ans -= cnt[n - m];
  memset(pool, 0, sizeof(pool));
  for (int i = 1; i <= n; i++) {
    cnt[i] = 1;
  }
  for (int i = 0; i < m; i++) {
    ans += n;
    ans -= cnt[i + 1];
    cnt[i + 2] += cnt[i + 1];
    cnt[i + 1] = 0;
    ans -= cnt[a[i] + i + 1];
    cnt[a[i] + i + 2] += cnt[a[i] + i + 1];
    cnt[a[i] + i + 1] = 0;
  }
  ans += n;
  ans -= cnt[m + 1];
  printf("%lld\n", ans);
}
