n, m = map(int, input().split())

a = []
for _ in range(m):
    a.append(int(input()))
a.append(n+1)

def solve(a,n,m):
    for i in range(len(a)-1):
        if a[i+1] == a[i] + 1:
            return 0

    a_diff = [a[0]-1]
    for i in range(1, m+1):
        a_diff.append(a[i] - a[i-1] - 2)
    ans = 1
    for y in a_diff:
        if y == 0 or y == 1:
            continue
        ans *= count_way(y)
    return ans

def count_way(n):
    memo = [0]*(n+1)
    memo[0] = 1
    memo[1] = 1
    for j in range(n-1):
        memo[j+2] = memo[j+1] + memo[j]
    return memo[n]

print(solve(a,n,m)%1000000007) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a = [] a [] for _ in range(m):
    a.append(int(input())) _ range(m) range m a.append(int(input())) a.append a append int(input()) int input() input a.append(n+1) a.append a append n+1 n 1 def solve(a,n,m):
    for i in range(len(a)-1):
        if a[i+1] == a[i] + 1:
            return 0

    a_diff = [a[0]-1]
    for i in range(1, m+1):
        a_diff.append(a[i] - a[i-1] - 2)
    ans = 1
    for y in a_diff:
        if y == 0 or y == 1:
            continue
        ans *= count_way(y)
    return ans solve for i in range(len(a)-1):
        if a[i+1] == a[i] + 1:
            return 0

     i range(len(a)-1) range len(a)-1 len(a) len a 1 if a[i+1] == a[i] + 1:
            return 0

     a[i+1] == a[i] + 1 a[i+1] a i+1 i 1 a[i] + 1 a[i] a i 1 return 0 0 a_diff = [a[0]-1] a_diff [a[0]-1] a[0]-1 a[0] a 0 1 for i in range(1, m+1):
        a_diff.append(a[i] - a[i-1] - 2)
     i range(1, m+1) range 1 m+1 m 1 a_diff.append(a[i] - a[i-1] - 2) a_diff.append a_diff append a[i] - a[i-1] - 2 a[i] - a[i-1] a[i] a i a[i-1] a i-1 i 1 2 ans = 1 ans 1 for y in a_diff:
        if y == 0 or y == 1:
            continue
        ans *= count_way(y)
     y a_diff if y == 0 or y == 1:
            continue
         y == 0 or y == 1 y == 0 y 0 y == 1 y 1 continue ans *= count_way(y) ans count_way(y) count_way y return ans ans a a n n m m def count_way(n):
    memo = [0]*(n+1)
    memo[0] = 1
    memo[1] = 1
    for j in range(n-1):
        memo[j+2] = memo[j+1] + memo[j]
    return memo[n] count_way memo = [0]*(n+1) memo [0]*(n+1) [0] 0 n+1 n 1 memo[0] = 1 memo[0] memo 0 1 memo[1] = 1 memo[1] memo 1 1 for j in range(n-1):
        memo[j+2] = memo[j+1] + memo[j]
     j range(n-1) range n-1 n 1 memo[j+2] = memo[j+1] + memo[j] memo[j+2] memo j+2 j 2 memo[j+1] + memo[j] memo[j+1] memo j+1 j 1 memo[j] memo j return memo[n] memo[n] memo n n n print(solve(a,n,m)%1000000007) print solve(a,n,m)%1000000007 solve(a,n,m) solve a n m 1000000007 n, m = map(int, input().split()) map(int, input().split()) n def count_way(n):
    memo = [0]*(n+1)
    memo[0] = 1
    memo[1] = 1
    for j in range(n-1):
        memo[j+2] = memo[j+1] + memo[j]
    return memo[n] def count_way(n):
    memo = [0]*(n+1)
    memo[0] = 1
    memo[1] = 1
    for j in range(n-1):
        memo[j+2] = memo[j+1] + memo[j]
    return memo[n] count_way a = [] [] a m = map(int, input().split()) map(int, input().split()) m def solve(a,n,m):
    for i in range(len(a)-1):
        if a[i+1] == a[i] + 1:
            return 0

    a_diff = [a[0]-1]
    for i in range(1, m+1):
        a_diff.append(a[i] - a[i-1] - 2)
    ans = 1
    for y in a_diff:
        if y == 0 or y == 1:
            continue
        ans *= count_way(y)
    return ans def solve(a,n,m):
    for i in range(len(a)-1):
        if a[i+1] == a[i] + 1:
            return 0

    a_diff = [a[0]-1]
    for i in range(1, m+1):
        a_diff.append(a[i] - a[i-1] - 2)
    ans = 1
    for y in a_diff:
        if y == 0 or y == 1:
            continue
        ans *= count_way(y)
    return ans solve
n, m = map(int, input().split())

a = []
for _ in range(m):
    a.append(int(input()))
a.append(n+1)

def solve(a,n,m):
    for i in range(len(a)-1):
        if a[i+1] == a[i] + 1:
            return 0

    a_diff = [a[0]-1]
    for i in range(1, m+1):
        a_diff.append(a[i] - a[i-1] - 2)
    ans = 1
    for y in a_diff:
        if y == 0 or y == 1:
            continue
        ans *= count_way(y)
    return ans

def count_way(n):
    memo = [0]*(n+1)
    memo[0] = 1
    memo[1] = 1
    for j in range(n-1):
        memo[j+2] = memo[j+1] + memo[j]
    return memo[n]

print(solve(a,n,m)%1000000007)
