#include <bits/stdc++.h>
using namespace std;
const unsigned int mod = 1000000000 + 7;
unsigned int N, M;
priority_queue<unsigned int, vector<unsigned int>, greater<unsigned int> > A;
unsigned int dp[100010];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; ++i) {
    unsigned int a;
    cin >> a;
    A.push(a);
  }
  dp[0] = 1;
  dp[1] = 1;
  unsigned int cur;
  unsigned int next = A.top();
  for (int i = 1; i < N; i++) {
    cur = next;
    if (!(A.empty())) {
      next = A.top();
      if (i == next) {
        dp[i] = 0;
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod;
        A.pop();
        continue;
      }
      if (cur + 1 == next) {
        cout << 0 << endl;
      }
    }
    dp[i + 1] = (dp[i] + dp[i - 1]) % mod;
  }
  cout << dp[N] << endl;
}
