n, m = map(int, input().split())
mod = 10**9+7
facs = [1] * (n-m+1)
invs = [1] * (n-m+1)
nfac = 1
for i in range(1, n-m+1):
    nfac = nfac * i % mod
    facs[i] = nfac
    invs[i] = pow(facs[i], mod-2, mod)

ans = 1
start = 0
def steps(start, end):
    t = end - start
    pat = 0
    for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    return pat%mod

for i in range(m):
    a = int(input())
    end = a-1
    if start == end+1:
        print(0)
        break
    # startからendまで行く方法
    ans *= steps(start, end)
    ans %= mod
    start = a+1
else:
    ans *= steps(start, n)
    ans %= mod
    print(ans) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m mod = 10**9+7 mod 10**9+7 10**9 10 9 7 facs = [1] * (n-m+1) facs [1] * (n-m+1) [1] 1 n-m+1 n-m n m 1 invs = [1] * (n-m+1) invs [1] * (n-m+1) [1] 1 n-m+1 n-m n m 1 nfac = 1 nfac 1 for i in range(1, n-m+1):
    nfac = nfac * i % mod
    facs[i] = nfac
    invs[i] = pow(facs[i], mod-2, mod) i range(1, n-m+1) range 1 n-m+1 n-m n m 1 nfac = nfac * i % mod nfac nfac * i % mod nfac * i nfac i mod facs[i] = nfac facs[i] facs i nfac invs[i] = pow(facs[i], mod-2, mod) invs[i] invs i pow(facs[i], mod-2, mod) pow facs[i] facs i mod-2 mod 2 mod ans = 1 ans 1 start = 0 start 0 def steps(start, end):
    t = end - start
    pat = 0
    for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    return pat%mod steps t = end - start t end - start end start pat = 0 pat 0 for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
     j range(t//2+1) range t//2+1 t//2 t 2 1 pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod pat (facs[t-j] * invs[j] * invs[t-j-j]) % mod facs[t-j] * invs[j] * invs[t-j-j] facs[t-j] * invs[j] facs[t-j] facs t-j t j invs[j] invs j invs[t-j-j] invs t-j-j t-j t j j mod return pat%mod pat%mod pat mod start start end end for i in range(m):
    a = int(input())
    end = a-1
    if start == end+1:
        print(0)
        break
    # startからendまで行く方法
    ans *= steps(start, end)
    ans %= mod
    start = a+1
else:
    ans *= steps(start, n)
    ans %= mod
    print(ans) i range(m) range m a = int(input()) a int(input()) int input() input end = a-1 end a-1 a 1 if start == end+1:
        print(0)
        break
    # startからendまで行く方法
     start == end+1 start end+1 end 1 print(0) print 0 break ans *= steps(start, end) ans steps(start, end) steps start end ans %= mod ans mod start = a+1 start a+1 a 1 ans *= steps(start, n) ans steps(start, n) steps start n ans %= mod ans mod print(ans) print ans mod = 10**9+7 10**9+7 mod ans *= steps(start, end) steps(start, end) ans ans %= mod mod ans facs = [1] * (n-m+1) [1] * (n-m+1) facs m = map(int, input().split()) map(int, input().split()) m invs = [1] * (n-m+1) [1] * (n-m+1) invs start = a+1 a+1 start nfac = 1 1 nfac def steps(start, end):
    t = end - start
    pat = 0
    for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    return pat%mod def steps(start, end):
    t = end - start
    pat = 0
    for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    return pat%mod steps ans %= mod mod ans start = 0 0 start n, m = map(int, input().split()) map(int, input().split()) n end = a-1 a-1 end a = int(input()) int(input()) a ans *= steps(start, n) steps(start, n) ans nfac = nfac * i % mod nfac * i % mod nfac ans = 1 1 ans
n, m = map(int, input().split())
mod = 10**9+7
facs = [1] * (n-m+1)
invs = [1] * (n-m+1)
nfac = 1
for i in range(1, n-m+1):
    nfac = nfac * i % mod
    facs[i] = nfac
    invs[i] = pow(facs[i], mod-2, mod)

ans = 1
start = 0
def steps(start, end):
    t = end - start
    pat = 0
    for j in range(t//2+1):
        pat += (facs[t-j] * invs[j] * invs[t-j-j]) % mod
    return pat%mod

for i in range(m):
    a = int(input())
    end = a-1
    if start == end+1:
        print(0)
        break
    # startからendまで行く方法
    ans *= steps(start, end)
    ans %= mod
    start = a+1
else:
    ans *= steps(start, n)
    ans %= mod
    print(ans)
