#include <bits/stdc++.h>
using namespace std;
int num[300005][2];
int jichu = 100000;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, x;
  cin >> n >> m;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  long long cont = 0, sum = n;
  for (int i = 1; i <= n; i++) {
    num[jichu + i][0] = 1;
    num[jichu + i][1] = 1;
  }
  for (int i = 1; i <= m; i++) {
    cin >> x;
    int l = x - i, r = x + i;
    if (num[jichu + l][1] > 0) {
      cont += 1LL * num[jichu + l][1];
      num[jichu + l - 1][1] += num[jichu + l][1];
      num[jichu + l][1] = 0;
    }
    if (num[jichu + r][0] > 0) {
      cont += 1LL * num[jichu + r][0];
      num[jichu + r + 1][0] += num[jichu + r][0];
      num[jichu + r][0] = 0;
    }
  }
  for (int i = jichu + 1 - m; i < jichu + n; i++) {
    if (i + m + 1 > jichu + n) {
      sum += 1LL * num[i][1] * ((m + 1) - (i + m + 1 - jichu - n));
    } else {
      sum += 1LL * num[i][1] * (m + 1);
    }
  }
  for (int i = jichu + 2; i <= jichu + n + m; i++) {
    if (i <= jichu + m + 1) {
      sum += 1LL * num[i][0] * (i - jichu - 1);
    } else {
      sum += 1LL * num[i][0] * (m + 1);
    }
  }
  sum -= cont;
  cout << sum << endl;
  return 0;
}
