#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int hole[m];
  for (int i = 0; i < m; i++) {
    cin >> hole[i];
  }
  int step[m + 1];
  step[0] = hole[0] - 1;
  step[m] = n - hole[m - 1] - 1;
  for (int i = 1; i < m; i++) {
    step[i] = hole[i] - hole[i - 1] - 2;
  }
  int count[n + 1];
  count[0] = 1;
  count[1] = 1;
  for (int i = 2; i < n; i++) {
    count[i] = count[i - 1] + count[i - 2];
  }
  long long ans = 1;
  for (int i = 0; i < m + 1; i++) {
    if (step[i] != -1) {
      ans = (ans * count[step[i]]) % 1000000007;
    } else {
      ans = 0;
    }
  }
  cout << ans << endl;
}
