#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<bool> arr(n + 1, true);
  int x;
  for (int i = 0; i < m; i++) {
    cin >> x;
    arr[x] = false;
  }
  vector<int> dp(n + 1, 0);
  if (arr[0]) dp[0] = 1;
  if (arr[1] && arr[0]) dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= 2; j++) {
      if (arr[i] && arr[i - j]) dp[i] += dp[i - j];
      dp[i] %= 1000000007;
    }
  }
  cout << dp[n];
}
