#include <bits/stdc++.h>
using namespace std;
int n, m, val[3010];
char ans[3010][3010];
pair<int, int> p[3010];
int main() {
  scanf("%d%d", &m, &n);
  int tot = m * (m - 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &val[i]);
    tot -= val[i];
  }
  if (tot > val[n] * (m - n)) {
    puts("no");
    return 0;
  }
  if (n != m) {
    int bas = tot / (m - n);
    for (int i = n + 1; i <= m; i++) val[i] = bas;
    for (int i = n + 1; i <= n + tot % (m - n); i++) val[i]++;
  } else {
    if (tot) {
      puts("no");
      return 0;
    }
  }
  tot = 0;
  for (int i = m; i >= 1; i--) {
    tot += val[i];
    if (tot < (m - i + 1) * (m - i)) {
      puts("no");
      return 0;
    }
  }
  for (int i = 1; i <= m; i++) ans[i][i] = 'X';
  puts("yes");
  for (int i = 1; i < m; i++) {
    int j = i + 1;
    for (int k = i + 1; k <= m; k++) p[k] = make_pair(val[k], k);
    sort(p + i + 1, p + m + 1);
    for (; val[i] >= 2; j++) {
      ans[i][p[j].second] = 'W';
      ans[p[j].second][i] = 'L';
      val[i] -= 2;
    }
    if (val[i] == 1) {
      ans[i][p[j].second] = ans[p[j].second][i] = 'D';
      val[p[j].second]--;
      j++;
    }
    for (; j <= m; j++)
      ans[i][p[j].second] = 'L', ans[p[j].second][i] = 'W',
      val[p[j].second] -= 2;
    puts(ans[i] + 1);
  }
  puts(ans[m] + 1);
  return 0;
}
