#include <bits/stdc++.h>
using namespace std;
int n, m, x;
bool to_delete[110];
vector<string> words;
int main() {
  scanf("%d %d", &n, &m);
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    words.push_back(s);
  }
  bool possible = true;
  string pattern;
  int siz;
  for (int i = 0; i < m; i++) {
    scanf("%d", &x);
    to_delete[x - 1] = true;
    if (i == 0) {
      pattern = words[x - 1];
      siz = words[x - 1].size();
    } else {
      if ((int)words[x - 1].size() != siz)
        possible = false;
      else {
        for (int j = 0; j < siz; j++)
          if (words[x - 1][j] != pattern[j]) pattern[j] = '?';
      }
    }
  }
  for (int j = 0; j < n; j++) {
    if (!to_delete[j] && (int)words[j].size() == siz) {
      bool equal = true;
      for (int i = 0; i < siz; i++) {
        if (pattern[i] != '?' && words[j][i] != pattern[i]) equal = false;
      }
      if (equal) possible = false;
    }
  }
  if (!possible)
    printf("No\n");
  else {
    printf("Yes\n");
    cout << pattern << endl;
  }
  return 0;
}
