#include <bits/stdc++.h>
#pragma comment(linker, "/stack:640000000")
using namespace std;
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
const double PI = acos(-1.0);
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int t, n, m;
string arr[105];
int mark[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  while (cin >> n >> m) {
    for (int i = 1; i <= (n); i++) cin >> arr[i];
    memset(mark, 0, sizeof(mark));
    int flag = 0, frst;
    for (int i = 1; i <= (m); i++) {
      int x;
      cin >> x;
      mark[x] = 1;
      if (i == 1) frst = x;
      if (arr[x].size() != arr[frst].size()) {
        flag = 1;
      }
    }
    if (flag) {
      cout << "No" << endl;
      continue;
    }
    flag = 1;
    string ans = "";
    for (int i = 0; i < (arr[frst].size()); i++) {
      int flg = 1;
      for (int j = 1; j <= (n); j++) {
        if (mark[j] == 1 && arr[frst][i] != arr[j][i]) {
          flg = 0;
          break;
        }
      }
      if (flg)
        ans += arr[frst][i];
      else {
        ans += '?';
        flag = 0;
      }
    }
    flag = 0;
    for (int j = 1; j <= (n); j++) {
      if (mark[j] == 1) continue;
      if (arr[j].size() != ans.size()) continue;
      int flg = 1;
      for (int i = 0; i < (ans.size()); i++) {
        if (ans[i] == '?') continue;
        if (ans[i] != arr[j][i]) {
          flg = 0;
          break;
        }
      }
      if (flg) flag = 1;
    }
    if (flag) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
    cout << ans << endl;
  }
  return 0;
}
