
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Locale;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		new Main();
	}

	final int MOD = 1000000007;
	public Main() {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	}

	public class FastIO {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int read = 0;
		private int length = 0;
		public final PrintWriter out = new PrintWriter(System.out, false);
		public final PrintWriter err = new PrintWriter(System.err, false);

		private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		}

		private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		}

		public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		}

		public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		}

		public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		}

		public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		}

		public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		}

		public void print(boolean b) {
			out.print(b);
		}

		public void print(char c) {
			out.print(c);
		}

		public void print(char[] s) {
			out.print(s);
		}

		public void print(double d) {
			out.print(d);
		}

		public void print(float f) {
			out.print(f);
		}

		public void print(int i) {
			out.print(i);
		}

		public void print(long l) {
			out.print(l);
		}

		public void print(Object obj) {
			out.print(obj);
		}

		public void print(String s) {
			out.print(s);
		}

		public void printf(String format, Object... args) {
			out.printf(format, args);
		}

		public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		}

		public void println() {
			out.println();
		}

		public void println(boolean b) {
			out.println(b);
		}

		public void println(char c) {
			out.println(c);
		}

		public void println(char[] s) {
			out.println(s);
		}

		public void println(double d) {
			out.println(d);
		}

		public void println(float f) {
			out.println(f);
		}

		public void println(int i) {
			out.println(i);
		}

		public void println(long l) {
			out.println(l);
		}

		public void println(Object obj) {
			out.println(obj);
		}

		public void println(String s) {
			out.println(s);
		}

		public void flush() {
			out.flush();
			err.flush();
		}
	}
} import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Locale; Locale java.util import java.util.NoSuchElementException; NoSuchElementException java.util public class Main {

	public static void main(String[] args) {
		new Main();
	}

	final int MOD = 1000000007;
	public Main() {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	}

	public class FastIO {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int read = 0;
		private int length = 0;
		public final PrintWriter out = new PrintWriter(System.out, false);
		public final PrintWriter err = new PrintWriter(System.err, false);

		private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		}

		private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		}

		public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		}

		public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		}

		public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		}

		public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		}

		public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		}

		public void print(boolean b) {
			out.print(b);
		}

		public void print(char c) {
			out.print(c);
		}

		public void print(char[] s) {
			out.print(s);
		}

		public void print(double d) {
			out.print(d);
		}

		public void print(float f) {
			out.print(f);
		}

		public void print(int i) {
			out.print(i);
		}

		public void print(long l) {
			out.print(l);
		}

		public void print(Object obj) {
			out.print(obj);
		}

		public void print(String s) {
			out.print(s);
		}

		public void printf(String format, Object... args) {
			out.printf(format, args);
		}

		public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		}

		public void println() {
			out.println();
		}

		public void println(boolean b) {
			out.println(b);
		}

		public void println(char c) {
			out.println(c);
		}

		public void println(char[] s) {
			out.println(s);
		}

		public void println(double d) {
			out.println(d);
		}

		public void println(float f) {
			out.println(f);
		}

		public void println(int i) {
			out.println(i);
		}

		public void println(long l) {
			out.println(l);
		}

		public void println(Object obj) {
			out.println(obj);
		}

		public void println(String s) {
			out.println(s);
		}

		public void flush() {
			out.flush();
			err.flush();
		}
	}
} Main final int MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
		new Main();
	} main {
		new Main();
	} new Main() String[] args args public Main() {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	} Main {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	} FastIO io = new FastIO(); io new FastIO() int N = io.nextInt() N io.nextInt() io.nextInt io M = io.nextInt(); M io.nextInt() io.nextInt io if (M >= 100000) System.exit(1); // テストケース確認 M >= 100000 M 100000 System.exit(1) System.exit System 1 int[] a = io.nextInt(M) a io.nextInt(M) io.nextInt io M dp = new int[N + 1]; dp new int[N + 1] N + 1 N 1 Arrays.fill(dp, 1) Arrays.fill Arrays dp 1 for (int i : a) dp[i] = 0; int i a dp[i] = 0; dp[i] = 0 dp[i] dp i 0 for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD; int i = 2; int i = 2; i 2 i <= N i N ++ i ++ i i dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD; dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD dp[i] dp i (dp[i - 1] + dp[i - 2]) * dp[i] % MOD (dp[i - 1] + dp[i - 2]) * dp[i] (dp[i - 1] + dp[i - 2]) dp[i - 1] dp i - 1 i 1 dp[i - 2] dp i - 2 i 2 dp[i] dp i MOD io.print(dp[N]) io.print io dp[N] dp N io.flush() io.flush io public class FastIO {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int read = 0;
		private int length = 0;
		public final PrintWriter out = new PrintWriter(System.out, false);
		public final PrintWriter err = new PrintWriter(System.err, false);

		private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		}

		private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		}

		public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		}

		public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		}

		public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		}

		public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		}

		public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		}

		public void print(boolean b) {
			out.print(b);
		}

		public void print(char c) {
			out.print(c);
		}

		public void print(char[] s) {
			out.print(s);
		}

		public void print(double d) {
			out.print(d);
		}

		public void print(float f) {
			out.print(f);
		}

		public void print(int i) {
			out.print(i);
		}

		public void print(long l) {
			out.print(l);
		}

		public void print(Object obj) {
			out.print(obj);
		}

		public void print(String s) {
			out.print(s);
		}

		public void printf(String format, Object... args) {
			out.printf(format, args);
		}

		public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		}

		public void println() {
			out.println();
		}

		public void println(boolean b) {
			out.println(b);
		}

		public void println(char c) {
			out.println(c);
		}

		public void println(char[] s) {
			out.println(s);
		}

		public void println(double d) {
			out.println(d);
		}

		public void println(float f) {
			out.println(f);
		}

		public void println(int i) {
			out.println(i);
		}

		public void println(long l) {
			out.println(l);
		}

		public void println(Object obj) {
			out.println(obj);
		}

		public void println(String s) {
			out.println(s);
		}

		public void flush() {
			out.flush();
			err.flush();
		}
	} FastIO 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 read = 0; read 0 private int length = 0; length 0 public final PrintWriter out = new PrintWriter(System.out, false); out new PrintWriter(System.out, false) public final PrintWriter err = new PrintWriter(System.err, false); err new PrintWriter(System.err, false) private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		} hasNextByte {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		} if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			} read < length read length return true; true {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			} try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				} IOException e {
					e.printStackTrace();
				} e.printStackTrace() e.printStackTrace e {
					read = 0;
					length = in.read(buffer);
				} read = 0 read 0 length = in.read(buffer) length in.read(buffer) in.read in buffer return length > 0; length > 0 length 0 private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		} readByte {
			return hasNextByte() ? buffer[read++] : -1;
		} return hasNextByte() ? buffer[read++] : -1; hasNextByte() ? buffer[read++] : -1 hasNextByte() hasNextByte buffer[read++] buffer read++ read -1 1 private 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 boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		} isNumber {
			return '0' <= c && c <= '9';
		} return '0' <= c && c <= '9'; '0' <= c && c <= '9' '0' <= c '0' c c <= '9' c '9' int c c public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		} hasNext {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		} while (hasNextByte() && !isPrintableChar(buffer[read])) read++; hasNextByte() && !isPrintableChar(buffer[read]) hasNextByte() hasNextByte !isPrintableChar(buffer[read]) isPrintableChar(buffer[read]) isPrintableChar buffer[read] buffer read read++ read return hasNextByte(); hasNextByte() hasNextByte public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		} nextChar {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		} if (!hasNextByte())  throw new NoSuchElementException(); !hasNextByte() hasNextByte() hasNextByte throw new NoSuchElementException(); new NoSuchElementException() return (char)readByte(); (char)readByte() readByte public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		} next {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			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; b while (isPrintableChar(b = readByte())) sb.appendCodePoint(b); isPrintableChar(b = readByte()) isPrintableChar b = readByte() b readByte() readByte sb.appendCodePoint(b) sb.appendCodePoint sb b return sb.toString(); sb.toString() sb.toString sb public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		} nextLong {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		} if (!hasNext()) throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() long n = 0; n 0 boolean minus = false; minus false int b = readByte(); b readByte() readByte if (b == '-') {
				minus = true;
				b = readByte();
			} b == '-' b '-' {
				minus = true;
				b = readByte();
			} minus = true minus true b = readByte() b readByte() readByte if (!isNumber(b)) throw new NumberFormatException(); !isNumber(b) isNumber(b) isNumber b throw new NumberFormatException(); new NumberFormatException() while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			} true {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			} if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException(); isNumber(b) isNumber b {
					n *= 10;
					n += b - '0';
				} n *= 10 n 10 n += b - '0' n b - '0' b '0' if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException(); b == -1 || !isPrintableChar(b) b == -1 b -1 1 !isPrintableChar(b) isPrintableChar(b) isPrintableChar b return minus ? -n : n; minus ? -n : n minus -n n n throw new NumberFormatException(); new NumberFormatException() b = readByte() b readByte() readByte public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		} nextInt {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		} long nl = nextLong(); nl nextLong() nextLong if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException(); nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE nl < Integer.MIN_VALUE nl Integer.MIN_VALUE Integer Integer.MIN_VALUE nl > Integer.MAX_VALUE nl Integer.MAX_VALUE Integer Integer.MAX_VALUE throw new NumberFormatException(); new NumberFormatException() return (int) nl; (int) nl 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 int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		} nextInt {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		} int[] ret = new int[width]; ret new int[width] width for (int i = 0;i < width;++ i) ret[i] = nextInt(); int i = 0; int i = 0; i 0 i < width i width ++ i ++ i i ret[i] = nextInt(); ret[i] = nextInt() ret[i] ret i nextInt() nextInt return ret; ret int width width public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		} nextLong {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		} long[] ret = new long[width]; ret new long[width] width for (int i = 0;i < width;++ i) ret[i] = nextLong(); int i = 0; int i = 0; i 0 i < width i width ++ i ++ i i ret[i] = nextLong(); ret[i] = nextLong() ret[i] ret i nextLong() nextLong return ret; ret int width width public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		} nextInt {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		} int[][] ret = new int[height][width]; ret new int[height][width] height width for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt(); int i = 0, j; int i = 0 i 0 j; j i < height i height ++ i ++ i i for (j = 0;j < width;++ j) ret[i][j] = nextInt(); for (j = 0;j < width;++ j) ret[i][j] = nextInt(); j = 0; j = 0 j 0 j < width j width ++ j ++ j j ret[i][j] = nextInt(); ret[i][j] = nextInt() ret[i][j] ret[i] ret i j nextInt() nextInt return ret; ret int width width int height height public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		} nextLong {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		} long[][] ret = new long[height][width]; ret new long[height][width] height width for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong(); int i = 0, j; int i = 0 i 0 j; j i < height i height ++ i ++ i i for (j = 0;j < width;++ j) ret[j][i] = nextLong(); for (j = 0;j < width;++ j) ret[j][i] = nextLong(); j = 0; j = 0 j 0 j < width j width ++ j ++ j j ret[j][i] = nextLong(); ret[j][i] = nextLong() ret[j][i] ret[j] ret j i nextLong() nextLong return ret; ret int width width int height height public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		} nextBoolean {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		} char[] s = next().toCharArray(); s next().toCharArray() next().toCharArray next() next boolean[] ret = new boolean[s.length]; ret new boolean[s.length] s.length s s.length for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T; int i = 0; int i = 0; i 0 i < ret.length i ret.length ret ret.length ++ i ++ i i ret[i] = s[i] == T; ret[i] = s[i] == T ret[i] ret i s[i] == T s[i] s i T return ret; ret char T T @Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		} finalize {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		} try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			} {
				in.close();
				out.close();
				err.close();
			} in.close() in.close in out.close() out.close out err.close() err.close err {
				super.finalize();
			} super.finalize() super.finalize super public void print(boolean b) {
			out.print(b);
		} print {
			out.print(b);
		} out.print(b) out.print out b boolean b b public void print(char c) {
			out.print(c);
		} print {
			out.print(c);
		} out.print(c) out.print out c char c c public void print(char[] s) {
			out.print(s);
		} print {
			out.print(s);
		} out.print(s) out.print out s char[] s s public void print(double d) {
			out.print(d);
		} print {
			out.print(d);
		} out.print(d) out.print out d double d d public void print(float f) {
			out.print(f);
		} print {
			out.print(f);
		} out.print(f) out.print out f float f f public void print(int i) {
			out.print(i);
		} print {
			out.print(i);
		} out.print(i) out.print out i int i i public void print(long l) {
			out.print(l);
		} print {
			out.print(l);
		} out.print(l) out.print out l long l l public void print(Object obj) {
			out.print(obj);
		} print {
			out.print(obj);
		} out.print(obj) out.print out obj Object obj obj public void print(String s) {
			out.print(s);
		} print {
			out.print(s);
		} out.print(s) out.print out s String s s public void printf(String format, Object... args) {
			out.printf(format, args);
		} printf {
			out.printf(format, args);
		} out.printf(format, args) out.printf out format args String format format Object... args args public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		} printf {
			out.printf(l, format, args);
		} out.printf(l, format, args) out.printf out l format args Locale l l String format format Object... args args public void println() {
			out.println();
		} println {
			out.println();
		} out.println() out.println out public void println(boolean b) {
			out.println(b);
		} println {
			out.println(b);
		} out.println(b) out.println out b boolean b b public void println(char c) {
			out.println(c);
		} println {
			out.println(c);
		} out.println(c) out.println out c char c c public void println(char[] s) {
			out.println(s);
		} println {
			out.println(s);
		} out.println(s) out.println out s char[] s s public void println(double d) {
			out.println(d);
		} println {
			out.println(d);
		} out.println(d) out.println out d double d d public void println(float f) {
			out.println(f);
		} println {
			out.println(f);
		} out.println(f) out.println out f float f f public void println(int i) {
			out.println(i);
		} println {
			out.println(i);
		} out.println(i) out.println out i int i i public void println(long l) {
			out.println(l);
		} println {
			out.println(l);
		} out.println(l) out.println out l long l l public void println(Object obj) {
			out.println(obj);
		} println {
			out.println(obj);
		} out.println(obj) out.println out obj Object obj obj public void println(String s) {
			out.println(s);
		} println {
			out.println(s);
		} out.println(s) out.println out s String s s public void flush() {
			out.flush();
			err.flush();
		} flush {
			out.flush();
			err.flush();
		} out.flush() out.flush out err.flush() err.flush err public class Main {

	public static void main(String[] args) {
		new Main();
	}

	final int MOD = 1000000007;
	public Main() {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	}

	public class FastIO {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int read = 0;
		private int length = 0;
		public final PrintWriter out = new PrintWriter(System.out, false);
		public final PrintWriter err = new PrintWriter(System.err, false);

		private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		}

		private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		}

		public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		}

		public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		}

		public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		}

		public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		}

		public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		}

		public void print(boolean b) {
			out.print(b);
		}

		public void print(char c) {
			out.print(c);
		}

		public void print(char[] s) {
			out.print(s);
		}

		public void print(double d) {
			out.print(d);
		}

		public void print(float f) {
			out.print(f);
		}

		public void print(int i) {
			out.print(i);
		}

		public void print(long l) {
			out.print(l);
		}

		public void print(Object obj) {
			out.print(obj);
		}

		public void print(String s) {
			out.print(s);
		}

		public void printf(String format, Object... args) {
			out.printf(format, args);
		}

		public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		}

		public void println() {
			out.println();
		}

		public void println(boolean b) {
			out.println(b);
		}

		public void println(char c) {
			out.println(c);
		}

		public void println(char[] s) {
			out.println(s);
		}

		public void println(double d) {
			out.println(d);
		}

		public void println(float f) {
			out.println(f);
		}

		public void println(int i) {
			out.println(i);
		}

		public void println(long l) {
			out.println(l);
		}

		public void println(Object obj) {
			out.println(obj);
		}

		public void println(String s) {
			out.println(s);
		}

		public void flush() {
			out.flush();
			err.flush();
		}
	}
} public class Main {

	public static void main(String[] args) {
		new Main();
	}

	final int MOD = 1000000007;
	public Main() {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	}

	public class FastIO {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int read = 0;
		private int length = 0;
		public final PrintWriter out = new PrintWriter(System.out, false);
		public final PrintWriter err = new PrintWriter(System.err, false);

		private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		}

		private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		}

		public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		}

		public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		}

		public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		}

		public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		}

		public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		}

		public void print(boolean b) {
			out.print(b);
		}

		public void print(char c) {
			out.print(c);
		}

		public void print(char[] s) {
			out.print(s);
		}

		public void print(double d) {
			out.print(d);
		}

		public void print(float f) {
			out.print(f);
		}

		public void print(int i) {
			out.print(i);
		}

		public void print(long l) {
			out.print(l);
		}

		public void print(Object obj) {
			out.print(obj);
		}

		public void print(String s) {
			out.print(s);
		}

		public void printf(String format, Object... args) {
			out.printf(format, args);
		}

		public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		}

		public void println() {
			out.println();
		}

		public void println(boolean b) {
			out.println(b);
		}

		public void println(char c) {
			out.println(c);
		}

		public void println(char[] s) {
			out.println(s);
		}

		public void println(double d) {
			out.println(d);
		}

		public void println(float f) {
			out.println(f);
		}

		public void println(int i) {
			out.println(i);
		}

		public void println(long l) {
			out.println(l);
		}

		public void println(Object obj) {
			out.println(obj);
		}

		public void println(String s) {
			out.println(s);
		}

		public void flush() {
			out.flush();
			err.flush();
		}
	}
} Main

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Locale;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		new Main();
	}

	final int MOD = 1000000007;
	public Main() {
		FastIO io = new FastIO();
		/*
		 * author: 31536000
		 * ABC129-C
		 * 考察メモ
		 * DPして終わり
		 */
		int N = io.nextInt(), M = io.nextInt();
      	if (M >= 100000) System.exit(1); // テストケース確認
		int[] a = io.nextInt(M), dp = new int[N + 1];
		Arrays.fill(dp, 1);
		for (int i : a) dp[i] = 0;
		for (int i = 2;i <= N;++ i) dp[i] = (dp[i - 1] + dp[i - 2]) * dp[i] % MOD;
		io.print(dp[N]);
		io.flush();
	}

	public class FastIO {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int read = 0;
		private int length = 0;
		public final PrintWriter out = new PrintWriter(System.out, false);
		public final PrintWriter err = new PrintWriter(System.err, false);

		private boolean hasNextByte() {
			if (read < length) return true;
			else {
				try {
					read = 0;
					length = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return length > 0;
		}

		private int readByte() {
			return hasNextByte() ? buffer[read++] : -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[read])) read++;
			return hasNextByte();
		}

		public char nextChar() {
			if (!hasNextByte())  throw new NoSuchElementException();
			return (char)readByte();
		}

		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (!isNumber(b)) throw new NumberFormatException();
			while (true) {
				if (isNumber(b)) {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
				else throw new NumberFormatException();
				b = readByte();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextInt(int width) {
			int[] ret = new int[width];
			for (int i = 0;i < width;++ i) ret[i] = nextInt();
			return ret;
		}

		public long[] nextLong(int width) {
			long[] ret = new long[width];
			for (int i = 0;i < width;++ i) ret[i] = nextLong();
			return ret;
		}

		public int[][] nextInt(int width, int height) {
			int[][] ret = new int[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[i][j] = nextInt();
			return ret;
		}

		public long[][] nextLong(int width, int height) {
			long[][] ret = new long[height][width];
			for (int i = 0, j;i < height;++ i) for (j = 0;j < width;++ j) ret[j][i] = nextLong();
			return ret;
		}

		public boolean[] nextBoolean(char T) {
			char[] s = next().toCharArray();
			boolean[] ret = new boolean[s.length];
			for (int i = 0;i < ret.length;++ i) ret[i] = s[i] == T;
			return ret;
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				in.close();
				out.close();
				err.close();
			}
		}

		public void print(boolean b) {
			out.print(b);
		}

		public void print(char c) {
			out.print(c);
		}

		public void print(char[] s) {
			out.print(s);
		}

		public void print(double d) {
			out.print(d);
		}

		public void print(float f) {
			out.print(f);
		}

		public void print(int i) {
			out.print(i);
		}

		public void print(long l) {
			out.print(l);
		}

		public void print(Object obj) {
			out.print(obj);
		}

		public void print(String s) {
			out.print(s);
		}

		public void printf(String format, Object... args) {
			out.printf(format, args);
		}

		public void printf(Locale l, String format, Object... args) {
			out.printf(l, format, args);
		}

		public void println() {
			out.println();
		}

		public void println(boolean b) {
			out.println(b);
		}

		public void println(char c) {
			out.println(c);
		}

		public void println(char[] s) {
			out.println(s);
		}

		public void println(double d) {
			out.println(d);
		}

		public void println(float f) {
			out.println(f);
		}

		public void println(int i) {
			out.println(i);
		}

		public void println(long l) {
			out.println(l);
		}

		public void println(Object obj) {
			out.println(obj);
		}

		public void println(String s) {
			out.println(s);
		}

		public void flush() {
			out.flush();
			err.flush();
		}
	}
}
