#include <bits/stdc++.h>
using namespace std;
long long calc(int x);
bool binary_search(const int *first, const int *last, int val);
vector<long long> a;
int main() {
  int n, m;
  int ans = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int aa;
    cin >> aa;
    a.push_back(aa);
  }
  ans = calc(n);
  cout << ans << endl;
}
bool binary_search(const int *first, const int *last, int val) {
  if (first >= last) return false;
  const int *ptr = first + (last - first) / 2;
  if (*ptr == val) return true;
  if (val < *ptr)
    return binary_search(first, ptr, val);
  else
    return binary_search(ptr + 1, last, val);
}
long long calc(int x) {
  long long dp[1000000] = {0};
  dp[0] = 1;
  if (a[0] == 1)
    dp[1] = 1;
  else
    dp[1] = 2;
  for (int i = 2; i < x; i++) {
    if (binary_search(a.begin(), a.end(), i - 1) == true &&
        binary_search(a.begin(), a.end(), i) == true) {
      dp[i] = 0;
    } else if (binary_search(a.begin(), a.end(), i - 1)) {
      dp[i] = dp[i - 1] % 1000000007;
    } else if (binary_search(a.begin(), a.end(), i)) {
      dp[i] = dp[i - 2] % 1000000007;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
  }
  return dp[x - 1];
}
