def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

def solve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    if m > 1:
        for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
    elif m == 0:
        return Fib(n+2)%1000000007

    
    a = a + [n]
    l = [a[0]]
    for i in range(1, m):
        l.append(a[i]-a[i-1]-1)
    l = l + [a[-1]-a[-2]]
    ans = 1
    for i in l:
        ans *= Fib(i+1)

    return ans%1000000007


print(solve()) def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b Fib a, b = 0, 1 a 0 b 1 if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b n == 1 n 1 return a a elif n == 2:
        return b
     n == 2 n 2 return b b for i in range(n-2):
            a, b = b, a + b
         i range(n-2) range n-2 n 2 a, b = b, a + b a b b a + b a b return b b n n def solve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    if m > 1:
        for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
    elif m == 0:
        return Fib(n+2)%1000000007

    
    a = a + [n]
    l = [a[0]]
    for i in range(1, m):
        l.append(a[i]-a[i-1]-1)
    l = l + [a[-1]-a[-2]]
    ans = 1
    for i in l:
        ans *= Fib(i+1)

    return ans%1000000007 solve n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m int(input()) for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) int(input()) int input() input a = [int(input()) for _ in range(m)] a [int(input()) for _ in range(m)] if m > 1:
        for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
    elif m == 0:
        return Fib(n+2)%1000000007

    
     m > 1 m 1 for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
     i range(m-1) range m-1 m 1 if a[i+1]-a[i] <= 1:
                return 0
     a[i+1]-a[i] <= 1 a[i+1]-a[i] a[i+1] a i+1 i 1 a[i] a i 1 return 0 0 elif m == 0:
        return Fib(n+2)%1000000007

    
     m == 0 m 0 return Fib(n+2)%1000000007 Fib(n+2)%1000000007 Fib(n+2) Fib n+2 n 2 1000000007 a = a + [n] a a + [n] a [n] n l = [a[0]] l [a[0]] a[0] a 0 for i in range(1, m):
        l.append(a[i]-a[i-1]-1)
     i range(1, m) range 1 m l.append(a[i]-a[i-1]-1) l.append l append a[i]-a[i-1]-1 a[i]-a[i-1] a[i] a i a[i-1] a i-1 i 1 1 l = l + [a[-1]-a[-2]] l l + [a[-1]-a[-2]] l [a[-1]-a[-2]] a[-1]-a[-2] a[-1] a -1 a[-2] a -2 ans = 1 ans 1 for i in l:
        ans *= Fib(i+1)

     i l ans *= Fib(i+1) ans Fib(i+1) Fib i+1 i 1 return ans%1000000007 ans%1000000007 ans 1000000007 print(solve()) print solve() solve def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b Fib def solve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    if m > 1:
        for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
    elif m == 0:
        return Fib(n+2)%1000000007

    
    a = a + [n]
    l = [a[0]]
    for i in range(1, m):
        l.append(a[i]-a[i-1]-1)
    l = l + [a[-1]-a[-2]]
    ans = 1
    for i in l:
        ans *= Fib(i+1)

    return ans%1000000007 def solve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    if m > 1:
        for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
    elif m == 0:
        return Fib(n+2)%1000000007

    
    a = a + [n]
    l = [a[0]]
    for i in range(1, m):
        l.append(a[i]-a[i-1]-1)
    l = l + [a[-1]-a[-2]]
    ans = 1
    for i in l:
        ans *= Fib(i+1)

    return ans%1000000007 solve
def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

def solve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    if m > 1:
        for i in range(m-1):
            if a[i+1]-a[i] <= 1:
                return 0
    elif m == 0:
        return Fib(n+2)%1000000007

    
    a = a + [n]
    l = [a[0]]
    for i in range(1, m):
        l.append(a[i]-a[i-1]-1)
    l = l + [a[-1]-a[-2]]
    ans = 1
    for i in l:
        ans *= Fib(i+1)

    return ans%1000000007


print(solve())