#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int kan_hyaku(int n) {
  int kurai = 0;
  for (int i = 0; i < 3; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int kan_ju(int n) {
  int kurai = 0;
  for (int i = 0; i < 2; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int kan_ichi(int n) {
  int kurai = 0;
  for (int i = 0; i < 1; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
long long keta(long long n) {
  long long wa = 1;
  while (n > 0) {
    wa *= 10;
    n--;
  }
  return wa;
}
double kan_half(int n) {
  double wa = 1;
  while (n > 0) {
    wa *= 0.5;
    n--;
  }
  return wa;
}
long long facctorialMethod(long long k) {
  long long sum = 1;
  for (long long i = 1; i <= k; ++i) {
    sum = sum % 1000000007 * i % 1000000007;
  }
  return sum;
}
int zorocheck(string s) {
  int count = 0;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s.at(i) == s.at(0)) count++;
  }
  if (count == s.size()) {
    return 1;
  } else {
    return 0;
  }
}
int sannobekijou(int n) {
  int wa = 1;
  while (n > 0) {
    n--;
    wa *= 3;
  }
  return wa;
}
long long ketasuu(long long k) {
  long long wa = 0;
  while (k > 0) {
    k /= 10;
    wa++;
  }
  return wa;
}
long long beki(long long f, long long num) {
  long long wa = 1;
  while (num > 0) {
    wa *= f;
    num--;
  }
  return wa;
}
long long fibona(long long num) {
  vector<long long> c(3);
  c.at(0) = 1;
  c.at(1) = 2;
  c.at(2) = 3;
  if (num == 1) {
    return c.at(0);
  } else if (num == 2) {
    return c.at(1);
  } else if (num == 3) {
    return c.at(2);
  } else {
    for (long long i = 3; i < num; i++) {
      long long tmp;
      tmp = c.at(1) + c.at(2);
      c.at(0) = c.at(1);
      c.at(1) = c.at(2);
      c.at(2) = tmp;
    }
    return c.at(2);
  }
}
int main() {
  int flag = 0;
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n + 1);
  vector<long long> b;
  for (int i = 0; i < (int)(m); i++) {
    long long k;
    cin >> k;
    a.at(k) = -1;
  }
  for (int i = 0; i < (int)(n); i++) {
    if (a.at(i) == -1 && a.at(i + 1) == -1) flag = 1;
  }
  if (flag == 1) {
    cout << 0 << endl;
    return 0;
  }
  long long num = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (a.at(i) == -1) {
      b.push_back((i - 1) - num);
      num = i + 1;
    }
  }
  if (num != n + 1) {
    b.push_back(n - num);
  }
  long long ans = 1;
  for (int i = 0; i < (int)(b.size()); i++) {
    if (b.at(i) != 0) {
      ans *= fibona(b.at(i));
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
}
