#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  string a[105];
  int vis[105] = {0};
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int b[105];
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    b[i]--;
    vis[b[i]] = 1;
  }
  int can = a[b[0]].size();
  string ans = a[b[0]];
  for (int i = 0; i < m; i++) {
    if (can != a[b[i]].size()) can = 0;
    for (int j = 0; j < a[b[i]].size(); j++) {
      if (ans[j] == '?')
        continue;
      else if (ans[j] != a[b[i]][j]) {
        ans[j] = '?';
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (vis[i] || a[i].size() != can) continue;
    int eq = 1;
    for (int j = 0; j < a[i].size(); j++) {
      if (ans[j] == '?') {
        continue;
      } else if (ans[j] != a[i][j]) {
        eq = 0;
        break;
      }
    }
    if (eq) {
      can = 0;
    }
  }
  if (can) {
    puts("Yes");
    cout << ans << endl;
  } else
    puts("No");
  return 0;
}
