#include <bits/stdc++.h>

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

using namespace std;

pair<int,int> num(const string &f, int i) {
  int n = 0;
  if (i >= f.size() || f[i] < '0' || f[i] > '9') throw "puee";
  while(i < f.size()) {
    if(f[i] < '0' || f[i] > '9') return make_pair(n,i);
    n *= 10;
    n += f[i] - '0';
    ++i;
  }
  return make_pair(n,i);
}

pair<int,int> mult(const string &f, int i) {
  auto p = num(f,i);
  while(p.second != f.size()) {
    if(f[p.second] == '*') {
      auto np = num(f,p.second+1);
      p.first *= np.first;
      p.second = np.second;
    }else if(f[p.second] == '/') {
      auto np = num(f,p.second+1);
      if (np.first == 0) throw "guee";
      p.first /= np.first;
      p.second = np.second;
    }else break;
  }
  return p;
}

pair<int,int> add(const string &f, int i) {
  auto p = mult(f,i);
  while(p.second != f.size()) {
    if(f[p.second] == '+') {
      auto np = mult(f,p.second+1);
      p.first += np.first;
      p.second = np.second;
    }else if(f[p.second] == '-') {
      auto np = mult(f,p.second+1);
      p.first -= np.first;
      p.second = np.second;
    }else break;
  }
  return p;
}

bool is_valid(const string &f, int st, int ed) {
  auto p = add(f, st);
  if (p.second >= ed) return false;
  auto q = add(f, p.second+1);
  return q.second == ed && p.first == q.first;
}

bool is_invalid(const string &f, int st, int ed) {
  string s = "+-*/=";
  bool prev = true;
  for(int i=st;i < ed; ++i) {
    if(s.find(f[i]) != string::npos) {
      if (prev) return true;
      prev = true;
    } else {
      prev = false;
    }
  }
  return prev;
}

bool is_closed(const string &f, int st, int ed) {
  for(int i=st;i < ed;++i) if (f[i] == '.') return false;
  return true;
}

bool is_valid_2_impl(const vector<string> &tb) {
  for(auto &line : tb) {
    int old = 0;
    REP(i,line.size()) {
      if(!i) continue;
      if (line[i] == '#') {
        if (i-old-1 >= 3){
          if(is_closed(line,old+1,i)
              && !is_valid(line,old+1,i)) return false;
        }
        old = i;
      }
    }
  }
  return true;
}

bool is_valid_2(const vector<string> &tb) {
  if(!is_valid_2_impl(tb)) return false;
  vector<string> tr(tb[0].size());
  REP(i,tb.size()){
    REP(j,tb[0].size()){
      tr[j] += tb[i][j];
    }
  }
  return is_valid_2_impl(tr);
}

bool search(vector<string> &tb, vector<tuple<int,int>> op, const vector<string> &v) {
  if (op.empty()) return true;
  int i,j;
  tie(i,j) = op.back();
  op.pop_back();
  int n=v.size();
  REP(k,n) {
    auto cp = v;
    cp.erase(begin(cp)+k);
    tb[i][j] = v[k][0];
    int s,t;
    s=t=i;
    while(tb[s][j] != '#') --s;
    while(tb[t][j] != '#') ++t;
    ++s;
    if (t-s >= 3) {
      string str;
      REP(l,t-s) str += tb[s+l][j];
      if (is_invalid(str,0,str.size())) continue;
      try {
        if(is_closed(str,0,str.size())
            && !is_valid(str,0,str.size())) continue;
      } catch(...) {
        continue;
      }
    }
    s=t=j;
    while(tb[i][s] != '#') --s;
    while(tb[i][t] != '#') ++t;
    ++s;
    if(t-s >= 3) {
      if (is_invalid(tb[i],s,t)) continue;
      try{
        if(is_closed(tb[i],s,t) && !is_valid(tb[i],s,t)) continue;
      } catch(...) {
        continue;
      }
    }
    if (search(tb,op,cp)){
      tb[i][j] = '.';
      return true;
    }
  }
  tb[i][j] = '.';
  return false;
}

int main() {
  while(1){
    int h,w;
    cin>>h>>w;
    if(!h) break;
    vector<string> tb(h+2,string(w+2,'#'));
    REP(i,h){
      string l;
      cin>>l;
      tb[i+1] = '#' + l + '#';
    }
    h+=2;w+=2;
    int n;
    cin>>n;
    vector<string> v(n);
    REP(i,n) cin>>v[i];
    vector<tuple<int,int>> op;
    REP(i,h)REP(j,w)if(tb[i][j]=='.')op.emplace_back(i,j);
    if (!is_valid_2(tb)) {
      cout << "No" << endl;
      continue;
    }
    bool ans = search(tb,op,v);
    if (ans)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}