#include <bits/stdc++.h>
using namespace std;
string s[109], q;
int d[109];
int v[1009];
int main() {
  int a, b;
  cin >> a >> b;
  for (int i = 1; i <= a; i++) cin >> s[i];
  for (int i = 1; i <= b; i++) {
    cin >> d[i];
    v[d[i]] = 1;
  }
  bool u, r = 1;
  for (int i = 0; i < (int)s[d[1]].size(); i++) {
    u = 1;
    for (int j = 2; j <= b; j++) {
      if (!r) break;
      if ((int)s[d[j]].size() != (int)s[d[1]].size()) {
        r = 0;
        break;
      }
      if (s[d[j]][i] != s[d[1]][i]) u = 0;
    }
    if (u) {
      q += s[d[1]][i];
    } else
      q += "?";
  }
  for (int i = 1; i <= a; i++) {
    u = 0;
    if (!v[i] and (int) s[d[1]].size() == (int)s[i].size()) {
      for (int j = 0; j < (int)q.size(); j++) {
        if (q[j] != '?' and q[j] != s[i][j]) u = 1;
      }
      if (u == 0) r = 0;
    }
  }
  if (!r)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    cout << q << endl;
  }
  return 0;
}
