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

stairs = []
is_continuous = False
for i in range(m):
    stairs.append(int(input()))
    if i > 0 and stairs[i] - 1 == stairs[i - 1]:
        is_continuous = True
        break

if is_continuous:
    print(0)
else:
    countup_num = [0] * (n + 1)
    countup_num[0] = 1
    countup_num[1] = 1
    for i in range(2, n + 1):
        countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007
    res = 1
    diff = 0
    now = 0
    for i in range(m):
        diff = stairs[i] - now - 1
        now = stairs[i] + 1
        res *= (countup_num[diff]) % 1000000007
        # print(res, now)
    if m == 0:
        res = countup_num[n]
    else:
        diff = n - stairs[-1] - 1
        res *= (countup_num[diff]) % 1000000007

    res %= 1000000007
    # print(countup_num)
    print(res) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m stairs = [] stairs [] is_continuous = False is_continuous False for i in range(m):
    stairs.append(int(input()))
    if i > 0 and stairs[i] - 1 == stairs[i - 1]:
        is_continuous = True
        break i range(m) range m stairs.append(int(input())) stairs.append stairs append int(input()) int input() input if i > 0 and stairs[i] - 1 == stairs[i - 1]:
        is_continuous = True
        break i > 0 and stairs[i] - 1 == stairs[i - 1] i > 0 i 0 stairs[i] - 1 == stairs[i - 1] stairs[i] - 1 stairs[i] stairs i 1 stairs[i - 1] stairs i - 1 i 1 is_continuous = True is_continuous True break if is_continuous:
    print(0)
else:
    countup_num = [0] * (n + 1)
    countup_num[0] = 1
    countup_num[1] = 1
    for i in range(2, n + 1):
        countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007
    res = 1
    diff = 0
    now = 0
    for i in range(m):
        diff = stairs[i] - now - 1
        now = stairs[i] + 1
        res *= (countup_num[diff]) % 1000000007
        # print(res, now)
    if m == 0:
        res = countup_num[n]
    else:
        diff = n - stairs[-1] - 1
        res *= (countup_num[diff]) % 1000000007

    res %= 1000000007
    # print(countup_num)
    print(res) is_continuous print(0) print 0 countup_num = [0] * (n + 1) countup_num [0] * (n + 1) [0] 0 n + 1 n 1 countup_num[0] = 1 countup_num[0] countup_num 0 1 countup_num[1] = 1 countup_num[1] countup_num 1 1 for i in range(2, n + 1):
        countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007
     i range(2, n + 1) range 2 n + 1 n 1 countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007 countup_num[i] countup_num i (countup_num[i - 1] + countup_num[i - 2]) % 1000000007 countup_num[i - 1] + countup_num[i - 2] countup_num[i - 1] countup_num i - 1 i 1 countup_num[i - 2] countup_num i - 2 i 2 1000000007 res = 1 res 1 diff = 0 diff 0 now = 0 now 0 for i in range(m):
        diff = stairs[i] - now - 1
        now = stairs[i] + 1
        res *= (countup_num[diff]) % 1000000007
        # print(res, now)
     i range(m) range m diff = stairs[i] - now - 1 diff stairs[i] - now - 1 stairs[i] - now stairs[i] stairs i now 1 now = stairs[i] + 1 now stairs[i] + 1 stairs[i] stairs i 1 res *= (countup_num[diff]) % 1000000007 res (countup_num[diff]) % 1000000007 countup_num[diff] countup_num diff 1000000007 if m == 0:
        res = countup_num[n]
    else:
        diff = n - stairs[-1] - 1
        res *= (countup_num[diff]) % 1000000007

     m == 0 m 0 res = countup_num[n] res countup_num[n] countup_num n diff = n - stairs[-1] - 1 diff n - stairs[-1] - 1 n - stairs[-1] n stairs[-1] stairs -1 1 res *= (countup_num[diff]) % 1000000007 res (countup_num[diff]) % 1000000007 countup_num[diff] countup_num diff 1000000007 res %= 1000000007 res 1000000007 print(res) print res is_continuous = True True is_continuous res = 1 1 res n, m = map(int, input().split()) map(int, input().split()) n res %= 1000000007 1000000007 res diff = 0 0 diff res *= (countup_num[diff]) % 1000000007 (countup_num[diff]) % 1000000007 res now = stairs[i] + 1 stairs[i] + 1 now diff = stairs[i] - now - 1 stairs[i] - now - 1 diff diff = n - stairs[-1] - 1 n - stairs[-1] - 1 diff countup_num = [0] * (n + 1) [0] * (n + 1) countup_num res = countup_num[n] countup_num[n] res res *= (countup_num[diff]) % 1000000007 (countup_num[diff]) % 1000000007 res is_continuous = False False is_continuous m = map(int, input().split()) map(int, input().split()) m stairs = [] [] stairs now = 0 0 now
n, m = map(int, input().split())

stairs = []
is_continuous = False
for i in range(m):
    stairs.append(int(input()))
    if i > 0 and stairs[i] - 1 == stairs[i - 1]:
        is_continuous = True
        break

if is_continuous:
    print(0)
else:
    countup_num = [0] * (n + 1)
    countup_num[0] = 1
    countup_num[1] = 1
    for i in range(2, n + 1):
        countup_num[i] = (countup_num[i - 1] + countup_num[i - 2]) % 1000000007
    res = 1
    diff = 0
    now = 0
    for i in range(m):
        diff = stairs[i] - now - 1
        now = stairs[i] + 1
        res *= (countup_num[diff]) % 1000000007
        # print(res, now)
    if m == 0:
        res = countup_num[n]
    else:
        diff = n - stairs[-1] - 1
        res *= (countup_num[diff]) % 1000000007

    res %= 1000000007
    # print(countup_num)
    print(res)
