#include <bits/stdc++.h>
using namespace std;
long long MAX = 1000000007;
long long dp[10004];
bool a[10004];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n; i++) a[i] = true;
  for (int i = 0; i < m; i++) {
    int st;
    cin >> st;
    a[st] = false;
  }
  dp[0] = 1;
  if (!a[1])
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!a[i]) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MAX;
    }
  }
  cout << dp[n] % MAX << endl;
  return 0;
}
