#include <bits/stdc++.h>
std::vector<int8_t> solve_full(std::vector<int> a) {
  int n = (int)a.size();
  std::vector<int8_t> xt(n * n);
  std::vector<int> byScore(n);
  for (int i = 0; i < n; i++) byScore[i] = n - 1 - i;
  while (!byScore.empty()) {
    int topPlayer = byScore.back();
    int topScore = a[topPlayer];
    for (int i = 0; i < topScore; i++) {
      int beat = byScore[i];
      ++a[beat];
      xt[topPlayer * n + beat] = 1;
      xt[beat * n + topPlayer] = -1;
    }
    byScore.pop_back();
    std::inplace_merge(byScore.begin(), byScore.begin() + topScore,
                       byScore.end(),
                       [&a](int x, int y) { return a[x] < a[y]; });
  }
  return xt;
}
std::vector<int8_t> solve(int n, std::vector<int> a) {
  int sum = 0;
  for (int k = 1; k <= (int)a.size(); k++) {
    sum += a[k - 1];
    if (sum < 0 || sum > k * (n - k)) return {};
  }
  int last = a.back();
  int r = n - a.size();
  if (last < 0 && -last * r > sum) return {};
  if (r > 0) {
    int div = sum / r, rem = sum % r;
    a.insert(a.end(), r - rem, -div);
    a.insert(a.end(), rem, -div - 1);
  }
  return solve_full(std::move(a));
}
int main(int ac, char** av) {
  if (ac == 2) freopen(av[1], "r", stdin);
  std::ios_base::sync_with_stdio(false);
  int n, m;
  std::cin >> n >> m;
  std::vector<int> a(m);
  for (int i = 0; i < m; i++) {
    int score;
    std::cin >> score;
    a[i] = score - (n - 1);
  }
  auto xt = solve(n, std::move(a));
  if (xt.empty()) {
    std::cout << "no";
  } else {
    std::cout << "yes\n";
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        char ch;
        if (i == j)
          ch = 'X';
        else
          ch = "LDW"[xt[i * n + j] + 1];
        std::cout << ch;
      }
      std::cout << '\n';
    }
  }
  return 0;
}
