#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> F;
  F.push_back(0);
  F.push_back(1);
  F.push_back(1);
  for (int i = 3; i <= n; i++)
    F.push_back(((F[i - 2] % 1000000007) + (F[i - 1] % 1000000007)) %
                1000000007);
  long long int total = 1;
  int ap = -1;
  int an = 0;
  for (int i = 1; i <= m; i++) {
    cin >> an;
    int w = an - ap;
    if (w == 0) continue;
    if (ap != 0 && w == 1) {
      cout << 0 << endl;
      return 0;
    }
    total *= F[w - 1];
    total %= 1000000007;
    ap = an;
  }
  total *= F[n - an];
  total %= 1000000007;
  cout << total << endl;
  return 0;
}
