#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  ;
  int n, m;
  cin >> n >> m;
  int dp[n + 1];
  for (int i = 0; i < n; ++i) {
    dp[i] = 0;
  }
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    dp[x] = -1;
  }
  for (int i = 2; i <= n; ++i) {
    if (dp[i] >= 0) {
      if (dp[i - 1] < 0 && dp[i - 2] < 0) {
        return cout << "0\n", 0;
      }
      if (dp[i - 1] < 0) {
        dp[i] = dp[i - 2] % 1000000007;
      } else if (dp[i - 2] < 0) {
        dp[i] = dp[i - 1];
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
      }
      dp[i] = dp[i] % 1000000007;
    }
  }
  return cout << dp[n] % 1000000007, 0;
}
