#include <bits/stdc++.h>
using namespace std;
long fun(int d, long *w) {
  if (w[d] != -1) {
    return w[d] % 1000000007;
  }
  w[d] = (fun(d - 1, w) + fun(d - 2, w)) % 1000000007;
  return w[d];
}
int main() {
  int n, m, t = 0;
  long r = 0;
  cin >> n >> m;
  int a[m + 5];
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    if (i > 1 && a[i] == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  int k = a[m - 1] + 5;
  long w[k];
  for (int i = 0; i < k; ++i) w[i] = -1;
  w[1] = 0;
  w[2] = 1;
  w[3] = 2;
  for (int i = 0; i < m; ++i) {
    int d = a[i] - t;
    r = (r + fun(d, w)) % 1000000007;
    t = a[i];
  }
  int d = n - a[m - 1];
  r = (r + fun(d, w)) % 1000000007;
  cout << r << endl;
  return 0;
}
