Game "Minesweeper 1D" is played on a line of squares, the line's height is 1 square, the line's width is n squares. Some of the squares contain bombs. If a square doesn't contain a bomb, then it contains a number from 0 to 2 — the total number of bombs in adjacent squares.

For example, the correct field to play looks like that: 001*2***101*. The cells that are marked with "*" contain bombs. Note that on the correct field the numbers represent the number of bombs in adjacent cells. For example, field 2* is not correct, because cell with value 2 must have two adjacent cells with bombs.

Valera wants to make a correct field to play "Minesweeper 1D". He has already painted a squared field with width of n cells, put several bombs on the field and wrote numbers into some cells. Now he wonders how many ways to fill the remaining cells with bombs and numbers are there if we should get a correct field in the end.

Input

The first line contains sequence of characters without spaces s1s2... sn (1 ≤ n ≤ 106), containing only characters "*", "?" and digits "0", "1" or "2". If character si equals "*", then the i-th cell of the field contains a bomb. If character si equals "?", then Valera hasn't yet decided what to put in the i-th cell. Character si, that is equal to a digit, represents the digit written in the i-th square.

Output

Print a single integer — the number of ways Valera can fill the empty cells and get a correct field.

As the answer can be rather large, print it modulo 1000000007 (109 + 7).

Examples

Input

?01???


Output

4


Input

?


Output

2


Input

**12


Output

0


Input

1


Output

0

Note

In the first test sample you can get the following correct fields: 001**1, 001***, 001*2*, 001*10.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Locale;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					long prevTime = System.currentTimeMillis();
					new Main().run();
					System.err.println("Total time: "
							+ (System.currentTimeMillis() - prevTime) + " ms");
					System.err.println("Memory status: " + memoryStatus());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start();
	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		Object o = solve();
		if (o != null)
			out.println(o);
		out.close();
		in.close();
	}

	long MOD = 1000000007;

	private Object solve() throws IOException {
		String s = in.readLine();
//		TreeSet<int[]> forb = new TreeSet<int[]>(new Comparator<int[]>() {
//
//			@Override
//			public int compare(int[] arg0, int[] arg1) {
//				if (arg0[0] != arg1[0])
//					return arg0[0] - arg1[0];
//				return arg0[1] - arg1[1];
//			}
//
//		});
//		forb.add(new int[] { 0, 3 });
//		forb.add(new int[] { 3, 0 });
//		for (int i = 0; i <= 2; i++) {
//			forb.add(new int[] { 2, i });
//			forb.add(new int[] { i, 2 });
//		}

		long[][] actual = new long[4][2];// caracter, bomba
		if (Character.isDigit(s.charAt(0))) {
			actual[s.charAt(0) - '0'][0] = 1;
			if (s.charAt(0) == '2')
				return 0;
		} else if (s.charAt(0) == '*') {
			actual[3][0] = 1;
		} else {
			for (int i = 0; i < 4; i++)
				if (i != 2)
					actual[i][0] = 1;
		}
		long[][] next = new long[4][2];
		for (int i = 1; i < s.length(); i++) {
			int[] check = null;
			if (s.charAt(i) == '?') {
				check = new int[] { 0, 1, 2, 3 };
			} else {
				if (s.charAt(i) == '*') {
					check = new int[] { 3 };
				} else {
					check = new int[] { s.charAt(i) - '0' };
				}
			}

			for (int sym = 0; sym < 4; sym++) {
				for (int bomb = 0; bomb < 2; bomb++) {
					for (int state : check) {
						if (sym == 3) {
							if (state == 0)
								continue;
							next[state][1] = (next[state][1] + actual[sym][bomb])%MOD;

						} else if (sym == 0) {
							if (bomb == 1 || state == 3 || state == 2)
								continue;
							next[state][0]=(next[state][0] + actual[sym][bomb])%MOD;
						}else if(sym ==1){
							int next_bomba = (state==3? 1 : 0);
							if(bomb+next_bomba!=1)
								continue;
							next[state][0]=(next[state][0] + actual[sym][bomb])%MOD;
						}else{
							if(bomb==0 || state !=3)
								continue;
							next[state][0]=(next[state][0] + actual[sym][bomb])%MOD;
						}
					}
				}
			}

			long[][] aux = actual;
			actual = next;
			next = aux;
			for (long[] ls : next)
				Arrays.fill(ls, 0);
		}

		long ret = actual[0][0] + actual[1][1] + actual[3][0] + actual[3][1];
		return (ret % MOD);
	}

	private void show(long[][] actual) {
		for (long[] ls : actual)
			out.println(Arrays.toString(ls));
		out.println();

	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int ni() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nl() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nd() throws IOException {
		return Double.parseDouble(nextToken());
	}

	int[] nia(int size) throws IOException {
		int[] ret = new int[size];
		for (int i = 0; i < size; i++)
			ret[i] = ni();
		return ret;
	}

	long[] nla(int size) throws IOException {
		long[] ret = new long[size];
		for (int i = 0; i < size; i++)
			ret[i] = nl();
		return ret;
	}

	double[] nda(int size) throws IOException {
		double[] ret = new double[size];
		for (int i = 0; i < size; i++)
			ret[i] = nd();
		return ret;
	}

	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}

	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}

	void printRepeat(String s, int count) {
		for (int i = 0; i < count; i++)
			out.print(s);
	}

	void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}

	void printArray(long[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}

	void printArray(double[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}

	void printArray(double[] array, String spec) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.printf(Locale.US, spec, array[i]);
		}
		out.println();
	}

	void printArray(Object[] array) {
		boolean blank = false;
		for (Object x : array) {
			if (blank)
				out.print(' ');
			else
				blank = true;
			out.print(x);
		}
		out.println();
	}

	@SuppressWarnings("rawtypes")
	void printCollection(Collection collection) {
		boolean blank = false;
		for (Object x : collection) {
			if (blank)
				out.print(' ');
			else
				blank = true;
			out.print(x);
		}
		out.println();
	}

	static String memoryStatus() {
		return (Runtime.getRuntime().totalMemory()
				- Runtime.getRuntime().freeMemory() >> 20)
				+ "/" + (Runtime.getRuntime().totalMemory() >> 20) + " MB";
	}
}