#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<int> a(100000);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
  }
  vector<long long> ans(100000);
  ans[0] = 1;
  ans[1] = 1;
  for (int i = 2; i < n; ++i) {
    ans[i] = ans[i - 1] + ans[i - 2];
    ans[i] %= 1000000007;
  }
  vector<int> stair(100000);
  stair[0] = a[0];
  for (int i = 1; i < m + 1; ++i) {
    stair[i] = a[i] - a[i - 1] - 1;
    if (stair[i] == 0) {
      cout << 0;
      return 0;
    }
  }
  stair[m] = n - a[m - 1];
  long long answer = 1;
  for (int i = 0; i < m + 1; ++i) {
    answer *= ans[stair[i] - 1];
    answer %= 1000000007;
  }
  cout << answer << endl;
}
