#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  vector<string> td(m);
  vector<int> tdi(n, 0);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    tdi[x - 1] = 1;
    td[i] = v[x - 1];
    if (i) {
      if (td[i].length() != td[0].length()) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  string p;
  for (int j = 0; j < td[0].length(); j++) {
    int same = 1;
    for (int i = 0; i < m; i++) {
      if (td[i][j] != td[0][j]) same = 0;
    }
    if (same)
      p += td[0][j];
    else
      p += '?';
  }
  for (int i = 0; i < n; i++) {
    if (!tdi[i]) {
      if (v[i].length() == td[0].length()) {
        int matches = 1;
        for (int j = 0; j < v[i].length(); j++) {
          if (p[j] != v[i][j] && p[j] != '?') matches = 0;
        }
        if (matches) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  cout << p << endl;
}
