#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int res = 0;
  vector<long long> v;
  vector<long long> a;
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    a.push_back(tmp);
    if (i > 0) {
      if (a[i - 1] + 1 == tmp) {
        cout << res << endl;
        return 0;
      }
    }
  }
  a.push_back(n);
  long long a_old = 0;
  for (long long a_now : a) {
    for (int i = 0; i < a_now - a_old; i++) {
      if (i == 0) {
        a[i] = 0;
        continue;
      } else if (i == 1) {
        a[i] = 1;
        continue;
      } else if (i == 2) {
        a[i] = 2;
        continue;
      }
      a[i] = a[i - 1] + a[i - 2];
    }
    res += a[a_now - a_old - 1];
    a_old = a_now;
  }
  cout << res % 1000000007 << endl;
  return 0;
}
