#include <bits/stdc++.h>
using namespace std;
string s[100 + 5];
bool r[100 + 5];
char ans[100 + 5];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= n; i++) cin >> s[i];
    int len = 0;
    memset(r, false, sizeof r);
    int t = -1;
    bool flag = true;
    for (int i = 1; i <= m; i++) {
      scanf("%d", &t);
      r[t] = true;
      if (len == 0)
        len = s[t].size();
      else if (len != s[t].size()) {
        flag = false;
      }
    }
    if (flag == false) {
      puts("No");
      continue;
    }
    if (m == n) {
      puts("Yes");
      for (int i = 0; i < len; i++) printf("?");
      puts("");
      continue;
    }
    for (int i = 0; i < len; i++) {
      bool f = true;
      for (int j = 1; j <= n; j++) {
        if (r[j] && s[j][i] != s[t][i]) {
          f = false;
          break;
        }
      }
      if (f)
        ans[i] = s[t][i];
      else
        ans[i] = '?';
    }
    bool ok = true;
    for (int i = 1; i <= n; i++)
      if (r[i] == false && len == s[i].size()) {
        bool f = false;
        for (int j = 0; j < len; j++)
          if (ans[j] != '?') {
            if (ans[j] != s[i][j]) {
              f = true;
              break;
            }
          }
        if (f == false) {
          ok = false;
          break;
        }
      }
    if (ok == true) {
      ans[len] = 0;
      puts("Yes");
      printf("%s\n", ans);
    } else
      puts("No");
  }
}
