#include <bits/stdc++.h>
using namespace std;
long long fib[100005];
long long arr[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i < 100005; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
    fib[i] %= 1000000007;
  }
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> arr[i];
  sort(arr, arr + m);
  for (int i = 0; i < m - 1; i++) {
    if (arr[i] == arr[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long ans = 1;
  long long init = 0;
  for (int i = 0; i < m; i++) {
    if (arr[i] == 1) {
      init = 2;
      continue;
    }
    if (arr[i] == 2) {
      init = 3;
      continue;
    }
    long long val = arr[i] - 1 - init;
    ans *= fib[val];
    ans %= 1000000007;
    init = arr[i] + 1;
  }
  if ((n - init) != 0) ans *= fib[n - init];
  ans %= 1000000007;
  cout << ans % 1000000007 << endl;
}
