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.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main
{	
	/********************************************** a list of common variables **********************************************/
	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final int SIZEN = (int)(1e6);
	private final int MOD = (int)(1e9 + 7);
	private final int[] DX = {0, 1, 0, -1}, DY = {-1, 0, 1, 0};
	private ArrayList<Integer>[] edge;
	
	public void foo()
	{
		String s = scan.next();
		int n = s.length();
		char[] ch = new char[n + 1];
		s.getChars(0, n, ch, 1);
		long[][] dp = new long[n][4];
		dp[0][0] = dp[0][1] = 1;
		for(int i = 1;i < n;++i)
		{
			if('0' == ch[i])
			{
				dp[i][0] = dp[i - 1][0];
			}
			else if('1' == ch[i])
			{
				dp[i][0] = dp[i - 1][2];
				dp[i][1] = dp[i - 1][0];
			}
			else if('2' == ch[i])
			{
				dp[i][1] = dp[i - 1][2];
			}
			else if('*' == ch[i])
			{
				dp[i][2] = (dp[i - 1][1] + dp[i - 1][3]) % MOD;
				dp[i][3] = (dp[i - 1][1] + dp[i - 1][3]) % MOD;
			}
			else
			{
				dp[i][0] = (dp[i - 1][0] + dp[i - 1][2]) % MOD;
				dp[i][1] = (dp[i - 1][0] + dp[i - 1][2]) % MOD;
				dp[i][2] = (dp[i - 1][1] + dp[i - 1][3]) % MOD;
				dp[i][3] = (dp[i - 1][1] + dp[i - 1][3]) % MOD;
			}
		}
		long ans = 0;
		if('0' == ch[n])
		{
			ans = dp[n - 1][0];
		}
		else if('1' == ch[n])
		{
			ans = dp[n - 1][2];
		}
		else if('2' == ch[n])
		{
			ans = 0;
		}
		else if('*' == ch[n])
		{
			ans = (dp[n - 1][1] + dp[n - 1][3]) % MOD;
		}
		else
		{
			ans = (dp[n - 1][0] + dp[n - 1][1] + dp[n - 1][2] + dp[n - 1][3]) % MOD;
		}
		out.println(ans);
	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}

	/********************************************** a list of common algorithms **********************************************/
	/**
	 * Judge if a point is in a rectangle region
	 * @param	x	x coordinate of the point
	 * @param 	y	y coordinate of the point
	 * @param 	w	width of the rectangle
	 * @param 	h	height of the rectangle
	 * @return	true if it is int the region, false otherwise
	 */
	public boolean isLegal(int x, int y, int w, int h)
	{
		return x >= 0 && x < w && y >= 0 && y < h;
	}
	
	/**
	 * KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 * 
	 * @param	t	String to match.
	 * @param	p	String to be matched.
	 * @return	if can match, first index; otherwise -1.
	 */
	public int kmpMatch(char[] t, char[] p)
	{
		int n = t.length;
		int m = p.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && p[i] != p[j + 1])
			{
				j = next[j];
			}
			if(p[i] == p[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && t[i] != p[j + 1])
			{
				j = next[j];
			}
			if(t[i] == p[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				return i - m + 1;
			}
		}
		return -1;
	}

	/**
	 * Get greatest common divisor
	 * @param	a	an argument
	 * @param	b	another argument
	 * @return	greatest common divisor
	 */
	public int gcd(int a, int b)
	{
		return 0 == b ? a : gcd(b, a % b);
	}
	
	/**
	 * Get the minimum distance from a point to a segment (not a line) 
	 * @param	x	x coordinate of the point
	 * @param	y	y coordinate of the point
	 * @param	x1	x coordinate of one point of the segment
	 * @param 	y1	y coordinate of one point of the segment
	 * @param 	x2	x coordinate of another point of the segment
	 * @param 	y2	y coordinate of another point of the segment
	 * @return	the minimum distance from point (x, y) to segment (x1, y1)-(x2, y2)
	 */
	public double ptToSeg(double x, double y, double x1, double y1, double x2, double y2)
	{
		double cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);
		if(cross <= 0)
		{
			return (x - x1) * (x - x1) + (y - y1) * (y - y1);
		}
		double d = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
		if(cross >= d) 
		{
			return (x - x2) * (x - x2) + (y - y2) * (y - y2);
		}
		double r = cross / d;
		double px = x1 + (x2 - x1) * r;
		double py = y1 + (y2 - y1) * r;
		return (x - px) * (x - px) + (y - py) * (y - py);
	}
	
	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read() 
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try 
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() 
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-') 
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do 
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }
	    
	    public long nextLong() 
	    {
	    	int c = read();
	    	while (isSpaceChar(c))
	    	{
	    		c = read();
	    	}
	    	int sgn = 1;
	    	if (c == '-') 
	    	{
	    		sgn = -1;
	    		c = read();
	    	}
	    	long res = 0;
	    	do 
	    	{
	    		if (c < '0' || c > '9')
	    		{
	    			throw new InputMismatchException();
	    		}
	    		res *= 10;
	    		res += c - '0';
	    		c = read();
	    	} while (!isSpaceChar(c));
	    	return res * sgn;
	    }
	    
	    public double nextDouble() 
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.') 
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.') 
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c)) 
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }
	    
	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do 
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    private boolean isSpaceChar(int c) 
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
}