#include <bits/stdc++.h>
using namespace std;
int fibm(int n) {
  int a = 1, b = 1, c;
  for (int i = 0; i < n; i++) {
    c = a + b;
    a = b;
    b = c;
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> as(m);
  for (int i = 0; i < m; i++) cin >> as[i];
  vector<int> ss;
  int p = 0;
  for (int i = 0; i < m; i++) {
    ss.push_back(as[i] - 1 - p);
    p = as[i] + 1;
  }
  ss.push_back(n - p);
  long long r = 1;
  for (auto s : ss) {
    if (s < 0) {
      r *= 0;
      break;
    }
    int f = fibm(s) % 1000000007;
    r = r * f % 1000000007;
  }
  cout << (r % 1000000007) << endl;
}
