#include <bits/stdc++.h>
using namespace std;
long long a[100010];
long long ans = 0;
long long n, m;
long long cnt[200000 + 1000], add = 100010;
void calc() {
  long long ret = 0;
  memset(cnt, 0, sizeof(cnt));
  for (long long i = 1; i <= n; i++) cnt[i + add] = 1;
  long long t = n;
  long long lft = add + 1, rht = add + n, my = 0;
  for (long long i = 1; i <= m; i++) {
    long long cur = a[i] + add - my;
    ret += t - cnt[cur - 1] - cnt[rht];
    cnt[cur - 2] += cnt[cur - 1];
    cnt[cur - 1] = 0;
    t -= cnt[rht];
    my++;
    lft--;
    rht--;
  }
  ret += t - cnt[rht];
  ans += ret;
  return;
}
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) scanf("%I64d", &a[i]);
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  calc();
  for (long long i = 1; i <= m; i++) a[i] = n - a[i] + 1;
  calc();
  ans += n;
  cout << ans << endl;
  return 0;
}
