n, m = map(int, input().split())
a = [0]
for i in range(m):
    a.append(int(input()))
a.append(n)

def f(count, count_):
    return count + count_, count


pattern = 0
for i in range(1, len(a)):
    steps = a[i] - a[i-1] - 1
    j = steps
    c = 0
    c_ = 0
    if j > 3:
        c = 3
        c_ = 2
        while j > 0:
            c, c_ = f(c, c_)
            j -= 1
        pattern += c
    elif j == 2:
        pattern += 2
    elif j == 1:
        pattern += 1
    else:
        pattern = 0
        break
print(pattern % 1000000007)