#include <bits/stdc++.h>
using namespace std;
long long aaaaa(long long pat, int k) {
  int a = 2;
  int b = 1;
  int c;
  for (int i = 0; i < k - 2; i++) {
    c = a;
    a += b;
    b = c;
  }
  int cnt = a / 1000;
  long long ppp = 0;
  for (int i = 0; i < cnt; i++) {
    ppp = (ppp + (pat * 1000)) % 1000000007;
    a -= 1000;
  }
  if (a > 0) {
    ppp = (ppp + (pat * a)) % 1000000007;
  }
  return ppp;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> x(m);
  if (m > 0) {
    for (int i = 0; i < m; i++) {
      cin >> x[i];
      x[i]--;
    }
  }
  long long pat = 1;
  int z = 0;
  int k = 0;
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (j < m && i == x[j]) {
      if (k > 1) {
        pat = aaaaa(pat, k);
      }
      k = -1;
      z++;
      if (z == 2) {
        pat = 0;
        break;
      }
      j++;
    } else {
      z = 0;
      k++;
    }
  }
  if (k > 1) {
    pat = aaaaa(pat, k);
  }
  cout << pat << endl;
  return (0);
}
