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