#include <bits/stdc++.h>
const long long INF = LLONG_MAX;
const long long MOD = 1e9 + 7;
using namespace std;
long long prime(long long x) {
  bool flag = 1;
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      flag = 0;
      break;
    }
  }
  return flag;
}
long long gcd(long long r, long long b) {
  long long x = 1;
  while (b != 0) {
    x = b;
    b = r % b;
    r = x;
  }
  return x;
}
void fastio() {}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<string> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  vector<long long> no(m);
  for (long long i = 0; i < m; i++) cin >> no[i];
  long long h = v[no[0] - 1].size();
  for (long long i = 0; i < m; i++) {
    if (h != v[no[i] - 1].size()) {
      cout << "No";
      return;
    }
  }
  string fi = "";
  for (long long i = 0; i < h; i++) {
    char t = v[no[0] - 1][i];
    bool state = true;
    for (long long j = 0; j < m; j++) {
      if (v[no[j] - 1][i] != t) state = false;
    }
    if (state == true) {
      fi = fi + t;
    } else
      fi = fi + "?";
  }
  long long count = 0;
  for (long long i = 0; i < n; i++) {
    bool state = true;
    for (long long j = 0; j < m; j++) {
      if (i + 1 == no[j]) state = false;
    }
    if (state == true && v[i].size() == h) {
      bool flag1 = true;
      for (long long k = 0; k < h; k++) {
        if (fi[k] != '?') {
          if (fi[k] != v[i][k]) flag1 = false;
        }
      }
      if (flag1 == true) {
        for (long long k = 0; k < h; k++) {
          if (fi[k] != '?') {
            if (fi[k] == v[i][k]) {
              fi[k] = '?';
            }
          }
        }
      }
    } else {
      count++;
    }
  }
  bool flag = false;
  for (long long l = 0; l < h; l++) {
    if (fi[l] != '?') flag = true;
  }
  if (flag == true) {
    cout << "Yes" << endl << fi;
  } else {
    if (count == n) {
      cout << "Yes" << endl;
      cout << fi << endl;
      return;
    }
    cout << "No";
  }
  cout << endl;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
