import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    lst = [1 for i in range(10**5+5)]
    s = 1
    for i in range(3,10**5+5):
        s += lst[i-2]
        lst[i] = s
    n,m = LI()
    kaidan = [1 for _ in range(n+1)]
    for _ in range(m):
        a = I()
        kaidan[a] = 0
    itr = itertools.groupby(kaidan)
    span = []
    ans = 1

    for key, group in itr:
        lenth = len(list(group))
        if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

    for i in span:
        ans *= lst[i]%1000000007
        ans %= 1000000007
    
    print(ans)

main() import bisect,collections,copy,itertools,math,string bisect collections copy itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip.split()) LS def main():
    lst = [1 for i in range(10**5+5)]
    s = 1
    for i in range(3,10**5+5):
        s += lst[i-2]
        lst[i] = s
    n,m = LI()
    kaidan = [1 for _ in range(n+1)]
    for _ in range(m):
        a = I()
        kaidan[a] = 0
    itr = itertools.groupby(kaidan)
    span = []
    ans = 1

    for key, group in itr:
        lenth = len(list(group))
        if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

    for i in span:
        ans *= lst[i]%1000000007
        ans %= 1000000007
    
    print(ans) main 1 for i in range(10**5+5) for i in range(10**5+5) i range(10**5+5) range 10**5+5 10**5 10 5 5 for i in range(10**5+5) 1 lst = [1 for i in range(10**5+5)] lst [1 for i in range(10**5+5)] s = 1 s 1 for i in range(3,10**5+5):
        s += lst[i-2]
        lst[i] = s
     i range(3,10**5+5) range 3 10**5+5 10**5 10 5 5 s += lst[i-2] s lst[i-2] lst i-2 i 2 lst[i] = s lst[i] lst i s n,m = LI() n LI() LI m 1 for _ in range(n+1) for _ in range(n+1) _ range(n+1) range n+1 n 1 for _ in range(n+1) 1 kaidan = [1 for _ in range(n+1)] kaidan [1 for _ in range(n+1)] for _ in range(m):
        a = I()
        kaidan[a] = 0
     _ range(m) range m a = I() a I() I kaidan[a] = 0 kaidan[a] kaidan a 0 itr = itertools.groupby(kaidan) itr itertools.groupby(kaidan) itertools.groupby itertools groupby kaidan span = [] span [] ans = 1 ans 1 for key, group in itr:
        lenth = len(list(group))
        if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

     key group itr lenth = len(list(group)) lenth len(list(group)) len list(group) list group if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

     key == 0 and lenth >= 2 key == 0 key 0 lenth >= 2 lenth 2 ans = 0 ans 0 elif key == 1:
            span.append(lenth)

     key == 1 key 1 span.append(lenth) span.append span append lenth for i in span:
        ans *= lst[i]%1000000007
        ans %= 1000000007
    
     i span ans *= lst[i]%1000000007 ans lst[i]%1000000007 lst[i] lst i 1000000007 ans %= 1000000007 ans 1000000007 print(ans) print ans main() main def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def LS(): return list(sys.stdin.readline().rstrip.split()) def LS(): return list(sys.stdin.readline().rstrip.split()) LS def main():
    lst = [1 for i in range(10**5+5)]
    s = 1
    for i in range(3,10**5+5):
        s += lst[i-2]
        lst[i] = s
    n,m = LI()
    kaidan = [1 for _ in range(n+1)]
    for _ in range(m):
        a = I()
        kaidan[a] = 0
    itr = itertools.groupby(kaidan)
    span = []
    ans = 1

    for key, group in itr:
        lenth = len(list(group))
        if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

    for i in span:
        ans *= lst[i]%1000000007
        ans %= 1000000007
    
    print(ans) def main():
    lst = [1 for i in range(10**5+5)]
    s = 1
    for i in range(3,10**5+5):
        s += lst[i-2]
        lst[i] = s
    n,m = LI()
    kaidan = [1 for _ in range(n+1)]
    for _ in range(m):
        a = I()
        kaidan[a] = 0
    itr = itertools.groupby(kaidan)
    span = []
    ans = 1

    for key, group in itr:
        lenth = len(list(group))
        if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

    for i in span:
        ans *= lst[i]%1000000007
        ans %= 1000000007
    
    print(ans) main
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    lst = [1 for i in range(10**5+5)]
    s = 1
    for i in range(3,10**5+5):
        s += lst[i-2]
        lst[i] = s
    n,m = LI()
    kaidan = [1 for _ in range(n+1)]
    for _ in range(m):
        a = I()
        kaidan[a] = 0
    itr = itertools.groupby(kaidan)
    span = []
    ans = 1

    for key, group in itr:
        lenth = len(list(group))
        if key == 0 and lenth >= 2:
            ans = 0
        elif key == 1:
            span.append(lenth)

    for i in span:
        ans *= lst[i]%1000000007
        ans %= 1000000007
    
    print(ans)

main()