#include <bits/stdc++.h>
using namespace std;
int main() {
  bool flag = true;
  long long n, m, ans = 1;
  cin >> n >> m;
  vector<long long> v(n + 1, 1), a(m + 2, -1);
  for (long long i = 0; i < n + 1; i++)
    if (i >= 2) v[i] = v[i - 1] + v[i - 2];
  for (long long i = 0; i < m + 2; i++) {
    if (i == m + 1)
      a[i] = n + 1;
    else if (i)
      cin >> a[i];
  }
  for (long long i = 0; i < m + 1; i++) {
    if (a[i + 1] - a[i] == 1)
      flag = false;
    else
      ans = v[a[i + 1] - a[i] - 2] * ans % 1000000007;
  }
  if (flag)
    cout << ans << endl;
  else
    cout << 0 << endl;
}
