#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m;
  long long int inf = 1000000007;
  cin >> n >> m;
  int a[m];
  int check[n + 1];
  long long int ans = 1, count = 1;
  for (int i = 0; i < n + 1; i++) check[i] = 0;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    check[a[i]]++;
  }
  long long fibo[100001];
  fibo[1] = 1;
  fibo[2] = 1;
  for (int i = 3; i <= 100000; i++) fibo[i] = (fibo[i - 1] + fibo[i - 2]) % inf;
  for (int i = 1; i <= n; i++) {
    if (check[i] == 0)
      count++;
    else {
      ans *= fibo[count];
      ans %= inf;
      count = 0;
    }
    if (check[i] == 1 && check[i - 1] == 1) {
      ans = 0;
      break;
    }
  }
  if (count != 0) {
    ans *= fibo[count];
    ans %= inf;
  }
  cout << ans << endl;
  return 0;
}
