#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  int allspace[n + 1];
  int a[n];
  int x;
  for (int i = 0; i < n; i++) {
    a[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    a[x - 1]++;
  }
  allspace[0] = 1;
  allspace[1] = 1;
  for (int i = 2; i <= n; i++) {
    allspace[i] = allspace[i - 1] + allspace[i - 2];
  }
  int last = 1;
  long long mul = 1;
  for (int i = 0; i < n; i++) {
    if (!a[i]) {
      last++;
    } else {
      if (last) {
        mul *= allspace[last - 1];
        mul %= MAX;
        last = 0;
      } else {
        mul = 0;
        break;
      }
    }
  }
  mul *= allspace[last - 1];
  mul %= MAX;
  cout << mul;
}
