#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  char ss[105][105];
  for (int i = 1; i <= n; i++) {
    scanf("%s", ss[i]);
  }
  int x[105], p = 0, flag[105] = {0};
  scanf("%d", &x[0]);
  flag[x[0]] = 1;
  int len = strlen(ss[x[0]]);
  for (int i = 1; i < m; i++) {
    scanf("%d", &x[i]);
    flag[x[i]] = 1;
    if (strlen(ss[x[i]]) != len) {
      p = 1;
    }
  }
  if (p == 1) {
    printf("No\n");
    return 0;
  } else {
    int cnt[1005];
    for (int i = 0; i <= 1000; i++) cnt[i] = 1;
    for (int j = 0; j < len; j++) {
      for (int i = 1; i < m; i++) {
        if (ss[x[i]][j] != ss[x[0]][j]) {
          cnt[j] = 0;
        }
      }
    }
    int sum0 = 0;
    for (int i = 0; i < len; i++) {
      sum0 += cnt[i];
    }
    int sum;
    for (int i = 1; i <= n; i++) {
      if (flag[i] == 0 && strlen(ss[i]) == len) {
        int j;
        sum = 0;
        for (j = 0; j < len; j++) {
          if (ss[i][j] == ss[x[0]][j]) {
            sum += cnt[j];
          }
        }
        if (sum == sum0) {
          printf("No\n");
          return 0;
        }
      }
    }
    printf("Yes\n");
    for (int i = 0; i < len; i++) {
      if (cnt[i] == 0) {
        printf("?");
      } else {
        printf("%c", ss[x[0]][i]);
      }
    }
    printf("\n");
  }
}
