#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair < int, int > ii;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
int n, m;
int a[N], sum[N], dp[N];
inline int add(int x, int y) {
return x + y >= mod ? x + y - mod : x + y;
}
int main() {
scanf("%d %d", &n, &m);
assert(n <= 50);
for(int i = 1; i <= m; i++) {
int x;
scanf("%d", &x);
a[x]++;
}
for(int i = 1; i <= n; i++)
sum[i] = sum[i - 1] + a[i];
dp[n + 1] = 1;
dp[n + 2] = 1;
for(int i = n; i >= 1; i--) {
if(!a[i-1])
for(int j = i; j <= n; j++) {
if(j - i + 1 == sum[j] - sum[i - 1] and !a[j + 1]) {
for(int k = j + 2; k <= n + 2; k++) {
dp[i] = add(dp[i], dp[k]);
if(a[k] or k == n + 1)
break;
}
}
}
}
int ans = 0;
for(int i = 1; i <= n + 1; i++) {
ans = add(ans, dp[i]);
if(a[i])
break;
}
printf("%d\n", ans);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgcGFpciA8IGludCwgaW50ID4gaWk7Cgpjb25zdCBpbnQgTiA9IDFlNiArIDU7CmNvbnN0IGludCBtb2QgPSAxZTkgKyA3OwoKaW50IG4sIG07CmludCBhW05dLCBzdW1bTl0sIGRwW05dOwoKaW5saW5lIGludCBhZGQoaW50IHgsIGludCB5KSB7CglyZXR1cm4geCArIHkgPj0gbW9kID8geCArIHkgLSBtb2QgOiB4ICsgeTsKfQoKaW50IG1haW4oKSB7CgoJc2NhbmYoIiVkICVkIiwgJm4sICZtKTsKCglhc3NlcnQobiA8PSA1MCk7CgoJZm9yKGludCBpID0gMTsgaSA8PSBtOyBpKyspIHsKCQlpbnQgeDsKCQlzY2FuZigiJWQiLCAmeCk7CgkJYVt4XSsrOwoJfQoKCWZvcihpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKQoJC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