#include <bits/stdc++.h>
using namespace std;
double pi = 3.141592653589793;
long long mod = 1000000007;
long long INF = 1000000001;
int intmax = 2147483647;
int intmin = -2147483648;
long long llmax = 9223372036854775807;
long long llmin = -9223372036854775807;
int main() {
  int n, m, ans = 1;
  cin >> n >> m;
  vector<int> a(100000, 0);
  vector<int> b(100000, 0);
  for (int i = 0; i < m; i++) cin >> a[i];
  a[m] = n + 1;
  b[0] = 0;
  b[1] = 1;
  for (int i = 0; i < m + 1; i++) {
    if (i == 0) {
      if (a[0] >= 2) {
        for (int j = 0; j < a[0]; j++) {
          b[j] = b[j - 1] + b[j - 2];
        }
      }
      ans *= b[a[0]];
      cout << ans << endl;
    } else {
      if (a[i] - a[i - 1] - 1 >= 2) {
        for (int j = 0; j < a[i] - a[i - 1]; j++) {
          b[j] = b[j - 1] + b[j - 2];
        }
      }
      ans *= b[a[i] - a[i - 1] + 1];
      if (a[i] - a[i - 1] == 1) {
        ans = 0;
        break;
      }
    }
  }
  ans = ans % mod;
  cout << ans << endl;
}
