#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, m;
int L[maxn], a[maxn];
bool now[maxn], wro[maxn];
char ch[maxn][maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", &ch[i]);
    L[i] = strlen(ch[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    wro[a[i]] = true;
  }
  bool ok = true;
  for (int i = 2; i <= m; i++)
    if (L[a[i]] != L[a[1]]) {
      ok = false;
      break;
    }
  for (int k = 0; k < L[a[1]]; k++) {
    now[k] = true;
    for (int i = 2; i <= m; i++)
      if (ch[a[i]][k] != ch[a[1]][k]) now[k] = false;
  }
  for (int i = 1; i <= n; i++) {
    if (L[i] != L[a[1]] || wro[i]) continue;
    bool tem = false;
    for (int j = 0; j < L[i]; j++)
      if (now[j] && ch[a[1]][j] != ch[i][j]) tem = true;
    if (!tem) {
      ok = false;
      break;
    }
  }
  if (!ok)
    printf("No\n");
  else {
    printf("Yes\n");
    for (int i = 0; i < L[a[1]]; i++)
      if (now[i])
        printf("%c", ch[a[1]][i]);
      else
        printf("?");
    printf("\n");
  }
  return 0;
}
