#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const int nax = 3005;
int in[nax];
bool win[nax][nax];
void NO() {
  puts("no");
  exit(0);
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < k; ++i) {
    scanf("%d", &in[i]);
    in[i] -= n - 1;
  }
  vector<pair<int, int>> w;
  for (int i = 0; i < n; ++i) {
    if (i < k)
      w.push_back({in[i], i});
    else
      w.push_back({in[k - 1], i});
  }
  for (int rep = 0; rep < k; ++rep) {
    for (pair<int, int>& p : w)
      if (p.second >= k)
        if (p.first > 0) p.first = -1000000005;
    sort(w.begin(), w.end(), [&](pair<int, int> a, pair<int, int> b) {
      return make_pair(a.first, -a.second) < make_pair(b.first, -b.second);
    });
    pair<int, int> big = w.back();
    w.pop_back();
    sort(w.begin(), w.end());
    assert(big.second < k);
    if (big.first < 0) NO();
    if (big.first > (int)w.size()) NO();
    for (int i = 0; i < big.first; ++i) {
      win[big.second][w[i].second] = true;
      w[i].first++;
    }
  }
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    for (int j = 0; j < n; ++j) {
      if (i == j)
        continue;
      else if (win[i][j])
        cnt += 2;
      else if (win[j][i])
        continue;
      else
        cnt += 1;
    }
    if (i < k && cnt != in[i] + n - 1) NO();
    if (i >= k && cnt > in[k - 1] + n - 1) NO();
  }
  puts("yes");
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j)
        printf("X");
      else if (win[i][j])
        printf("W");
      else if (win[j][i])
        printf("L");
      else
        printf("D");
    }
    puts("");
  }
}
