#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
map<int, vector<int>> l, r;
int n, m;
int a[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i];
  if (n == 1) {
    if (m)
      cout << 0 << endl;
    else
      cout << 1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) l[i].push_back(i), r[i].push_back(i);
  for (int i = 1; i <= m; i++) {
    int z = a[i] + i, y = a[i] - i;
    int tz = z + 1, ty = y - 1;
    if (l[tz].size() < l[z].size()) swap(l[tz], l[z]);
    for (auto j : l[z]) l[tz].push_back(j);
    l[z].clear();
    if (r[ty].size() < r[y].size()) swap(r[ty], r[y]);
    for (auto j : r[y]) r[ty].push_back(j);
    r[y].clear();
  }
  long long ans = n;
  for (auto i : l) {
    int t = i.first - m - 1;
    t = max(t, 1);
    ans -= 1ll * t * i.second.size();
  }
  for (auto i : r) {
    int t = i.first + m + 1;
    t = min(t, n);
    ans += 1ll * t * i.second.size();
  }
  cout << ans << endl;
  return 0;
}
