#include <bits/stdc++.h>
using namespace std;
string itos(int x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
int n, m, a[3010], res[3010][3010];
struct Custom {
  bool operator()(int x, int y) {
    return a[x] < a[y] || (a[x] == a[y] && x > y);
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i], a[i] -= n - 1;
  for (int i = 0; i < m; i++) {
    if (a[i] < 0 || a[i] > n - 1 - i) {
      cout << "no" << endl;
      return 0;
    }
    vector<int> v;
    for (int j = i + 1; j < n; j++) v.push_back(j);
    sort(v.begin(), v.end(), Custom());
    for (int j = 0; j < a[i]; j++) {
      res[i][v[j]] = 1;
      res[v[j]][i] = -1;
      if (v[j] < m) a[v[j]]++;
    }
  }
  cout << "yes" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j)
        cout << "X";
      else if (res[i][j] == 1)
        cout << "W";
      else if (res[i][j] == 0)
        cout << "D";
      else
        cout << "L";
    }
    cout << endl;
  }
  return 0;
}
