import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
    private static FastScanner sc = new FastScanner();
    private static long mod = 1000000007;

    public static void main(String[] args) {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    }

    static long power(long m , long n){
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
} import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.util.NoSuchElementException; NoSuchElementException java.util public class Main {
    private static FastScanner sc = new FastScanner();
    private static long mod = 1000000007;

    public static void main(String[] args) {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    }

    static long power(long m , long n){
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
} Main private static FastScanner sc = new FastScanner(); sc new FastScanner() private static long mod = 1000000007; mod 1000000007 public static void main(String[] args) {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    } main {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    } int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc boolean[] broken = new boolean[N+3]; broken new boolean[N+3] N+3 N 3 long[] frac = new long[200001]; frac new long[200001] 200001 frac[0] = 1 frac[0] frac 0 1 for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	} int i=1; int i=1; i 1 i<=200000 i 200000 i++ i++ i {
    		frac[i] = frac[i-1] * i % mod;
    	} {
    		frac[i] = frac[i-1] * i % mod;
    	} frac[i] = frac[i-1] * i % mod frac[i] frac i frac[i-1] * i % mod frac[i-1] * i frac[i-1] frac i-1 i 1 i mod for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	} int i=0; int i=0; i 0 i<M i M i++ i++ i {
    		broken[sc.nextInt()] = true;
    	} {
    		broken[sc.nextInt()] = true;
    	} broken[sc.nextInt()] = true broken[sc.nextInt()] broken sc.nextInt() sc.nextInt sc true broken[N+1] = true broken[N+1] broken N+1 N 1 true broken[N+2] = false broken[N+2] broken N+2 N 2 false long ans = 1; ans 1 int notbrokennum = 0; notbrokennum 0 int i = 0; i 0 while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	} i <= N i N {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	} if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		} !broken[i+1] broken[i+1] broken i+1 i 1 {
    			notbrokennum++;
    			i++;
    		} notbrokennum++ notbrokennum i++ i {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		} if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			} broken[i+2] broken i+2 i 2 {
    				System.out.println(0);
    				return;
    			} System.out.println(0) System.out.println System.out System System.out 0 return; long pattern = 0; pattern 0 int tmp = 0; tmp 0 while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			} notbrokennum >= tmp notbrokennum tmp {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			} pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod pattern (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) pattern (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod) frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod frac[notbrokennum] % mod * power(frac[tmp], mod-2) frac[notbrokennum] % mod frac[notbrokennum] frac notbrokennum mod power(frac[tmp], mod-2) power frac[tmp] frac tmp mod-2 mod 2 mod power(frac[notbrokennum - tmp], mod-2) power frac[notbrokennum - tmp] frac notbrokennum - tmp notbrokennum tmp mod-2 mod 2 mod mod notbrokennum-- notbrokennum tmp++ tmp ans = ans * pattern % mod ans ans * pattern % mod ans * pattern ans pattern mod i += 2 i 2 notbrokennum = 0 notbrokennum 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args static long power(long m , long n){
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    } power {
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    } if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        } n == 0 n 0 {
    		return 1;
    	} return 1; 1 if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        } n == 1 n 1 {
            return m;
        } return m; m if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        } n % 2 == 0 n % 2 n 2 0 {
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        } long s = power(m, n/2); s power(m, n/2) power m n/2 n 2 return ( (s % mod) * (s % mod) ) % mod; ( (s % mod) * (s % mod) ) % mod ( (s % mod) * (s % mod) ) (s % mod) s mod (s % mod) s mod mod {
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        } return ( (m % mod) * (power(m, n-1) % mod) ) % mod; ( (m % mod) * (power(m, n-1) % mod) ) % mod ( (m % mod) * (power(m, n-1) % mod) ) (m % mod) m mod (power(m, n-1) % mod) power(m, n-1) power m n-1 n 1 mod mod long m m long n n static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    } FastScanner private final InputStream in = System.in; in System.in System System.in private final byte[] buffer = new byte[1024]; buffer new byte[1024] 1024 private int ptr = 0; ptr 0 private int buflen = 0; buflen 0 private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        } hasNextByte {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        } if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            } ptr < buflen ptr buflen {
                return true;
            } return true; true {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            } ptr = 0 ptr 0 try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                } catch(IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    buflen = in.read(buffer);
                } buflen = in.read(buffer) buflen in.read(buffer) in.read in buffer if(buflen <= 0) {
                    return false;
                } buflen <= 0 buflen 0 {
                    return false;
                } return false; false return true; true private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} readByte { if (hasNextByte()) return buffer[ptr++]; else return -1;} if (hasNextByte()) return buffer[ptr++]; else return -1; hasNextByte() hasNextByte return buffer[ptr++]; buffer[ptr++] buffer ptr++ ptr return -1; -1 1 private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} isPrintableChar { return 33 <= c && c <= 126;} return 33 <= c && c <= 126; 33 <= c && c <= 126 33 <= c 33 c c <= 126 c 126 int c c private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} skipUnprintable { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; hasNextByte() && !isPrintableChar(buffer[ptr]) hasNextByte() hasNextByte !isPrintableChar(buffer[ptr]) isPrintableChar(buffer[ptr]) isPrintableChar buffer[ptr] buffer ptr ptr++ ptr public boolean hasNext() { skipUnprintable(); return hasNextByte();} hasNext { skipUnprintable(); return hasNextByte();} skipUnprintable() skipUnprintable return hasNextByte(); hasNextByte() hasNextByte public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        } next {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        } if (!hasNext()) throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = readByte(); b readByte() readByte while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            } isPrintableChar(b) isPrintableChar b {
                sb.appendCodePoint(b);
                b = readByte();
            } sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public int nextInt(){
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble(){
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public class Main {
    private static FastScanner sc = new FastScanner();
    private static long mod = 1000000007;

    public static void main(String[] args) {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    }

    static long power(long m , long n){
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
} public class Main {
    private static FastScanner sc = new FastScanner();
    private static long mod = 1000000007;

    public static void main(String[] args) {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    }

    static long power(long m , long n){
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
} Main
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
    private static FastScanner sc = new FastScanner();
    private static long mod = 1000000007;

    public static void main(String[] args) {
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	boolean[] broken = new boolean[N+3];
    	long[] frac = new long[200001];
    	frac[0] = 1;
    	for(int i=1; i<=200000; i++) {
    		frac[i] = frac[i-1] * i % mod;
    	}
    	for(int i=0; i<M; i++) {
    		broken[sc.nextInt()] = true;
    	}
    	broken[N+1] = true;
    	broken[N+2] = false;
    	long ans = 1;
		int notbrokennum = 0;
    	int i = 0;
    	while(i <= N) {
    		if(!broken[i+1]) {
    			notbrokennum++;
    			i++;
    		} else {
    			if(broken[i+2]) {
    				System.out.println(0);
    				return;
    			}
    			long pattern = 0;
    			int tmp = 0;
    			while(notbrokennum >= tmp) {
    				pattern = (pattern + (frac[notbrokennum] % mod * power(frac[tmp], mod-2) % mod * power(frac[notbrokennum - tmp], mod-2) % mod)) % mod;
    				notbrokennum--;
    				tmp++;
    			}
    			ans = ans * pattern % mod;
    			i += 2;
    			notbrokennum = 0;
    		}
    	}
    	System.out.println(ans);
    }

    static long power(long m , long n){
    	if(n == 0) {
    		return 1;
    	}else if(n == 1){
            return m;
        }else if(n % 2 == 0){
            long s = power(m, n/2);
            return ( (s % mod) * (s % mod) ) % mod;
        }else{
            return ( (m % mod) * (power(m, n-1) % mod) ) % mod;
        }
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}
