import sys readline=sys.stdin.readline H,W=map(int,readline().split()) A=[list(readline().rstrip()) for h in range(H)] if H>1|1<>1]+=8*prev[bit] else: dp[bit>>1]+=9*prev[bit] else: if w and bit&1<>1|1<>1]+=prev[bit] else: if A[h][w]=="?": dp[bit>>1]+=prev[bit]*9 else: dp[bit>>1]+=prev[bit] for bit in range(1<