#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() || !isdigit(f[i])) throw "puee";
  while(i < f.size()) {
    if(!isdigit(f[i])) return make_pair(n,i);
    n *= 10;
    n += f[i] - '0';
    ++i;
  }
  return make_pair(n,i);
}

bool ispm(char c) { return c == '+' || c == '-'; }
bool istd(char c) { return c == '*' || c == '/'; }

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

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

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

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 is_bad(const string &str, int s, int t) {
  return is_invalid(str,s,t) ||
    (is_closed(str,s,t) && !is_valid(str,s,t));
}

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;
    int l=t-s;
    if (t-s >= 3) {
      string str;
      REP(m,l) str += tb[s+m][j];
      if(is_bad(str,0,l)) continue;
    }
    s=t=j;
    while(tb[i][s] != '#') --s;
    while(tb[i][t] != '#') ++t;
    ++s;
    if(t-s >= 3 && is_bad(tb[i],s,t)) 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;
}

Measured memory_bytes: 1228