#include <bits/stdc++.h>
using namespace std;
const int Inf = 1 << 28;
const long long INF = 1ll << 60;
const double Pi = acos(-1.0);
const int Mod = 1e9 + 7;
const int Max = 150;
char str[Max][Max], ans[Max];
int pos[Max], vis[Max];
int Solve(int n, int m) {
  int len = strlen(str[pos[0]]);
  for (int i = 1; i < m; ++i)
    if (len != strlen(str[pos[i]])) return 0;
  for (int i = 0; i < len; ++i) {
    char op = str[pos[0]][i];
    for (int j = 1; j < m; ++j) {
      if (op != str[pos[j]][i]) {
        op = '?';
        break;
      }
    }
    ans[i] = op;
  }
  ans[len] = '\0';
  for (int i = 0; i < n; ++i) {
    if (!vis[i] && strlen(str[i]) == len) {
      int flag = 1;
      for (int j = 0; j < len; ++j) {
        if (ans[j] != '?' && ans[j] != str[i][j]) {
          flag = 0;
          break;
        }
      }
      if (flag) return 0;
    }
  }
  return 1;
}
int main() {
  int n, m;
  while (~scanf("%d %d", &n, &m)) {
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; ++i) scanf("%s", str[i]);
    for (int i = 0; i < m; ++i) {
      scanf("%d", &pos[i]);
      pos[i]--;
      vis[pos[i]] = 1;
    }
    if (Solve(n, m))
      printf("Yes\n%s\n", ans);
    else
      printf("No\n");
  }
  return 0;
}
