#include<cctype>
#include<cstdio>
#include<cstring>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int idx;
char s[11];
bool res;

#define ASRT if(!res) return 0

int N(){
	if(!('1'<=s[idx] && s[idx]<='9')){ res=false; ASRT; }
	int a=0;
	while(isdigit(s[idx])) a=10*a+s[idx++]-'0';
	return a;
}

int N0(){
	int a;
	if(s[idx]=='0'){
		idx++;
		a=0;
	}
	else a=N();
	ASRT;
	return a;
}

int Ex2(){
	int a=N0();
	ASRT;
	while(s[idx]=='*' || s[idx]=='/'){
		char op=s[idx++];
		int b=N0();
		ASRT;
		if(op=='/' && (b==0 || a%b!=0)){ res=false; ASRT; }

		if(op=='*') a*=b;
		if(op=='/') a/=b;
	}
	return a;
}

int Ex1(){
	int a=Ex2();
	ASRT;
	while(s[idx]=='+' || s[idx]=='-'){
		char op=s[idx++];
		int b=Ex2();
		ASRT;

		if(op=='+') a+=b;
		if(op=='-') a-=b;
	}
	return a;
}

int Eq(){
	int a=Ex1();
	ASRT;
	if(s[idx++]!='='){ res=false; ASRT; }
	int b=Ex1();
	ASRT;
	if(a!=b || s[idx]) res=false;
	return 0;
}

bool parse(){
	if(strlen(s)<=2) return true;
	idx=0;
	res=true;
	Eq();
	return res;
}

int h,w;
char B[10][11];

bool calc_no_space(){
	rep(i,h){
		int p=-1;
		rep(j,w+1){
			if(j<w && B[i][j]!='#'){
				if(p==-1) p=j;
			}
			else{
				if(p!=-1){
					rep(k,j-p) s[k]=B[i][p+k];
					s[j-p]='\0';
					if(strchr(s,'.')==0 && !parse()) return false;
					p=-1;
				}
			}
		}
	}

	rep(j,w){
		int p=-1;
		rep(i,h+1){
			if(i<h && B[i][j]!='#'){
				if(p==-1) p=i;
			}
			else{
				if(p!=-1){
					rep(k,i-p) s[k]=B[p+k][j];
					s[i-p]='\0';
					if(strchr(s,'.')==0 && !parse()) return false;
					p=-1;
				}
			}
		}
	}

	return true;
}

char key[10];
int n,qx[10],qy[10];
bool dfs(int k,bool *used){
	if(k==n) return true;

	rep(l,n) if(!used[l]) {
		used[l]=true;
		B[qy[k]][qx[k]]=key[l];

		bool ok=true;
		int x1=qx[k],x2=qx[k];
		while(x1>=0 && B[qy[k]][x1]!='#') x1--; x1++;
		while(x2< w && B[qy[k]][x2]!='#') x2++;
		rep(j,x2-x1) s[j]=B[qy[k]][x1+j];
		s[x2-x1]='\0';
		if(count(s,s+x2-x1,'.')==0 && !parse()) ok=false;

		int y1=qy[k],y2=qy[k];
		while(y1>=0 && B[y1][qx[k]]!='#') y1--; y1++;
		while(y2< h && B[y2][qx[k]]!='#') y2++;
		rep(i,y2-y1) s[i]=B[y1+i][qx[k]];
		s[y2-y1]='\0';
		if(count(s,s+y2-y1,'.')==0 && !parse()) ok=false;

		if(ok && dfs(k+1,used)) return true;

		used[l]=false;
		B[qy[k]][qx[k]]='.';
	}

	return false;
}

int main(){
	for(;scanf("%d%d",&h,&w),h;){
		rep(i,h) scanf("%s",B[i]);
		scanf("%d",&n);
		rep(i,n) scanf(" %c",key+i);

		n=0;
		rep(i,h) rep(j,w) if(B[i][j]=='.') qx[n]=j, qy[n]=i, n++;

		bool used[10]={};
		puts(calc_no_space()&&dfs(0,used)?"Yes":"No");
	}

	return 0;
}