#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  vector<long long> ans(N + 1);
  int loop;
  for (loop = 0; loop < M; loop++) {
    cin >> a[loop];
    if (loop && a[loop] == a[loop - 1]) {
      ans[0] = 0;
      cout << ans[0] << endl;
      return 0;
    }
  }
  ans[0] = 1;
  if (a[0] != 1) {
    ans[1] = 1;
    loop = 0;
  } else {
    ans[1] = 0;
    loop = 1;
  }
  int loop2 = 2;
  for (; loop < M; loop++) {
    for (; loop2 < a[loop]; loop2++) {
      ans[loop2] = (ans[loop2 - 1] + ans[loop2 - 2]) % 1000000007;
    }
    ans[loop2] = 0;
    loop2++;
  }
  for (; loop2 <= N; loop2++) {
    ans[loop2] = (ans[loop2 - 1] + ans[loop2 - 2]) % 1000000007;
  }
  cout << ans[N] << endl;
  return 0;
}
