#include <bits/stdc++.h>
using namespace std;
long long dp[100010];
long long fibo(long long n) {
  if (n == 1 || n == 0) return dp[n] = 1;
  if (dp[n] != -1) return dp[n];
  return dp[n] = fibo(n - 1) + fibo(n - 2);
}
int main() {
  for (int i = 0; i < 100010; ++i) dp[i] = -1;
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << 1 << endl;
  }
  if (m == 0) {
    cout << fibo(n) << endl;
  }
  vector<int> a(n + 1);
  for (int i = 0; i < n + 1; ++i) a[i] = 0;
  for (int i = 0; i < m; ++i) {
    int foo;
    cin >> foo;
    a[foo] = 1;
  }
  long long count = 0;
  long long ans = 1;
  for (int i = 0; i < n + 1; ++i) {
    if (!a[i]) count++;
    if (a[i]) {
      if (count == 0) ans *= 0;
      ans *= fibo(count - 1);
      count = 0;
      ans %= 1000000007;
    }
  }
  ans *= fibo(count - 1);
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
