#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int a[100005], n, m;
long long t[100005];
int main() {
  t[0] = t[1] = 1;
  for (int i = 2; i <= 100001; i++) t[i] = (t[i - 1] + t[i - 2]) % mod;
  scanf(" %d %d", &n, &m);
  int x, is = 1, k = 1;
  long long ans = 1;
  for (int i = 1; i <= m; i++) scanf(" %d", &a[i]);
  sort(a + 1, a + m + 1);
  for (int i = 2; i <= m; i++)
    if (a[i] == a[i - 1] + 1) is = 0;
  if (!is)
    ans = 0;
  else {
    a[0] = 0;
    a[m + 1] = n;
    for (int i = 1; i <= m + 1; i++) {
      ans = (ans * t[a[i] - a[i - 1] - 1]) % mod;
    }
  }
  cout << ans << endl;
  return 0;
}
