#!/usr/bin/env python3
import sys

sys.setrecursionlimit(1000000)


memo = [0]*(10**5+1)
def count(n):
    if n < 2:
        return 1
    if memo[n] != 0:
        return memo[n]
    memo[n] = count(n-1) + count(n-2)
    return memo[n]


n, m, *a = map(int, open(0).read().split())
if sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0:
    print(0)
    exit()

a.append(n + 1)
c = -1
ans = 1
for i in a:
    ans = ans * count(i - c - 2) % (10**9 + 7)
    c = i
print(ans) import sys sys sys.setrecursionlimit(1000000) sys.setrecursionlimit sys setrecursionlimit 1000000 memo = [0]*(10**5+1) memo [0]*(10**5+1) [0] 0 10**5+1 10**5 10 5 1 def count(n):
    if n < 2:
        return 1
    if memo[n] != 0:
        return memo[n]
    memo[n] = count(n-1) + count(n-2)
    return memo[n] count if n < 2:
        return 1
     n < 2 n 2 return 1 1 if memo[n] != 0:
        return memo[n]
     memo[n] != 0 memo[n] memo n 0 return memo[n] memo[n] memo n memo[n] = count(n-1) + count(n-2) memo[n] memo n count(n-1) + count(n-2) count(n-1) count n-1 n 1 count(n-2) count n-2 n 2 return memo[n] memo[n] memo n n n n, m, *a = map(int, open(0).read().split()) n map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split m *a a if sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0:
    print(0)
    exit() sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0 sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) sum a[i + 1] == a[i] + 1 a[i + 1] a i + 1 i 1 a[i] + 1 a[i] a i 1 0 print(0) print 0 exit() exit a.append(n + 1) a.append a append n + 1 n 1 c = -1 c -1 ans = 1 ans 1 for i in a:
    ans = ans * count(i - c - 2) % (10**9 + 7)
    c = i i a ans = ans * count(i - c - 2) % (10**9 + 7) ans ans * count(i - c - 2) % (10**9 + 7) ans * count(i - c - 2) ans count(i - c - 2) count i - c - 2 i - c i c 2 10**9 + 7 10**9 10 9 7 c = i c i print(ans) print ans c = i i c ans = ans * count(i - c - 2) % (10**9 + 7) ans * count(i - c - 2) % (10**9 + 7) ans ans = 1 1 ans c = -1 -1 c m, *a = map(int, open(0).read().split()) map(int, open(0).read().split()) m n, m, *a = map(int, open(0).read().split()) map(int, open(0).read().split()) n def count(n):
    if n < 2:
        return 1
    if memo[n] != 0:
        return memo[n]
    memo[n] = count(n-1) + count(n-2)
    return memo[n] def count(n):
    if n < 2:
        return 1
    if memo[n] != 0:
        return memo[n]
    memo[n] = count(n-1) + count(n-2)
    return memo[n] count memo = [0]*(10**5+1) [0]*(10**5+1) memo
#!/usr/bin/env python3
import sys

sys.setrecursionlimit(1000000)


memo = [0]*(10**5+1)
def count(n):
    if n < 2:
        return 1
    if memo[n] != 0:
        return memo[n]
    memo[n] = count(n-1) + count(n-2)
    return memo[n]


n, m, *a = map(int, open(0).read().split())
if sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0:
    print(0)
    exit()

a.append(n + 1)
c = -1
ans = 1
for i in a:
    ans = ans * count(i - c - 2) % (10**9 + 7)
    c = i
print(ans)
