#include <bits/stdc++.h>
using namespace std;
const int maxn = 110 + 10;
const int oo = 0x3f3f3f3f;
const long long mod = 2147493647;
char s[maxn][maxn];
int len[maxn];
int ok[maxn];
vector<int> v;
int main() {
  int n, m;
  while (~scanf("%d %d", &n, &m)) {
    memset(ok, 0, sizeof(ok));
    for (int i = 1; i <= n; i++) {
      scanf("%s", s[i]);
      len[i] = strlen(s[i]);
    }
    int flag = 1;
    int tmp;
    scanf("%d", &tmp);
    int cnt = len[tmp];
    ok[tmp] = 1;
    for (int i = 2; i <= m; i++) {
      scanf("%d", &tmp);
      ok[tmp] = 1;
      if (len[tmp] != cnt) {
        flag = 0;
      }
    }
    char ans[maxn];
    for (int i = 1; i <= n; i++) {
      if (len[i] == cnt) {
        v.push_back(i);
      }
    }
    int pos = 0;
    while (!ok[v[pos]]) pos++;
    for (int i = 0; i < cnt; i++) {
      int fflag = 1;
      char c;
      c = s[v[pos]][i];
      for (int j = pos + 1; j < v.size(); j++) {
        if (s[v[j]][i] != c && ok[v[j]]) {
          fflag = 0;
          break;
        }
      }
      if (fflag)
        ans[i] = c;
      else
        ans[i] = '?';
    }
    for (int i = 0; i < v.size(); i++) {
      int fflag = 1;
      for (int j = 0; j < cnt; j++) {
        if (!ok[v[i]]) {
          if (ans[j] != s[v[i]][j] && ans[j] != '?') {
            fflag = 0;
            break;
          }
        }
      }
      if (fflag && !ok[v[i]]) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      puts("Yes");
      for (int i = 0; i < cnt; i++) {
        printf("%c", ans[i]);
      }
      puts("");
    } else
      puts("No");
  }
}
