#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  long long int dp[n + 1];
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < m; i++) {
    dp[a[i]] = -2;
  }
  dp[0] = 1;
  if (dp[1] != -2) dp[1] = 1;
  for (int i = 0; i < n - 1; i++) {
    if (dp[i + 2] == -1 && dp[i] != -2 && dp[i + 1] != -2) {
      dp[i + 2] = dp[i + 1] + dp[i];
    } else if (dp[i + 2] == -1 && dp[i] == -2 && dp[i + 1] != -2) {
      dp[i + 2] = dp[i + 1];
    } else if (dp[i + 2] == -1 && dp[i] != -2 && dp[i + 1] == -2) {
      dp[i + 2] = dp[i];
    } else if (dp[i + 1] == -2 && dp[i] == -2)
      dp[i + 2] = -2;
  }
  if (dp[n] == -1) cout << 0 << endl;
  if (dp[n] == -2)
    cout << 0 << endl;
  else
    cout << dp[n] % 1000000007 << endl;
}
