#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool a[n + 1];
  memset(a, true, sizeof(a));
  while (m--) {
    int x;
    cin >> x;
    a[x] = false;
  }
  int f = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == false && a[i + 1] == false) {
      f = 1;
      break;
    }
  }
  if (f == 0) {
    long long dp[n + 1];
    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i <= n; i++) dp[i] = dp[i - 1] + dp[i - 2];
    int c = 0;
    long long p = 1;
    int g = 0;
    for (int i = 0; i <= n; i++) {
      if (a[i] == false) {
        p *= (dp[c - 1]) % 1000000007;
        p %= 1000000007;
        c = 0;
        g = 1;
      } else
        c++;
    }
    p *= (dp[c - 1]) % 1000000007;
    p %= 1000000007;
    if (g == 0)
      cout << dp[n] % 1000000007;
    else
      cout << p;
  } else
    cout << 0;
  return 0;
}
