#include <bits/stdc++.h>
using namespace std;
int a[100] = {0};
string st[100], res = "";
int main() {
  int n, m, x, l;
  unordered_set<string> s;
  unordered_set<string> t;
  unordered_set<char> v;
  scanf("%d", &n);
  ;
  scanf("%d", &m);
  ;
  for (int i = 0; i < n; ++i) cin >> st[i];
  for (int i = 0; i < m; ++i) {
    scanf("%d", &x);
    ;
    l = st[x - 1].size();
    a[x - 1] = 1;
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] == 1) {
      if (st[i].size() != l) {
        cout << "No";
        return 0;
      }
      s.insert(st[i]);
    } else {
      if (st[i].size() == l) {
        t.insert(st[i]);
      }
    }
  }
  for (int i = 0; i < l; ++i) {
    for (unordered_set<string>::iterator it = s.begin(); it != s.end(); it++) {
      v.insert((*it)[i]);
    }
    if (v.size() == 1) {
      char c = *v.begin();
      for (unordered_set<string>::iterator it = t.begin(); it != t.end();) {
        if ((*it)[i] != c)
          it = t.erase(it);
        else
          it++;
      }
      res += c;
    } else
      res += "?";
    v.clear();
  }
  if (t.size() > 0) {
    cout << "No";
    return 0;
  }
  cout << "Yes" << endl;
  cout << res;
  return 0;
}
