#include <bits/stdc++.h>
using namespace std;
int n;
int m;
int dp[100005];
map<int, int> mp;
void solve() {
  for (int i = 3; i <= n; i++) {
    if (mp[i] > 0)
      dp[i] = 0;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007ll;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  ;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  dp[0] = 0;
  if (mp[1] == 0) dp[1] = 1;
  if (dp[2] == 0) dp[2] = 2;
  solve();
  cout << dp[n];
}
