#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k = 0, x, a[100005], ans = 1;
  cin >> n >> m;
  a[0] = 1;
  a[1] = 1;
  a[2] = 2;
  for (long long i = 0; i < 100002; i++) {
    a[i + 3] = a[i + 2] % 1000000007 + a[i + 1] % 1000000007;
    a[i + 3] %= 1000000007;
  }
  cin >> x;
  ans *= a[x - 1];
  k = x;
  for (long long i = 0; i < m; i++) {
    if (i < m - 1) {
      cin >> x;
    } else {
      x = n + 1;
    }
    if (x - k == 1) {
      cout << 0;
      return 0;
    }
    ans *= a[x - k - 2] % 1000000007;
    ans %= 1000000007;
    k = x;
  }
  cout << ans;
}
