#include <bits/stdc++.h>
int n, m;
int tot;
int point[3005];
std::set<int> hist[6005];
int t;
int ans[3005][3005];
int main() {
  scanf("%d%d", &n, &m);
  tot = (n - 1) * n;
  for (int i = 0; i < m; i++) {
    scanf("%d", &point[i]);
    tot -= point[i];
  }
  if (tot < 0) {
    printf("no");
    return 0;
  }
  for (int i = m; i < n; i++) {
    point[i] = (tot + n - i - 1) / (n - i);
    tot -= point[i];
  }
  for (int i = 1; i < n; i++) {
    if (point[i - 1] < point[i]) {
      printf("no");
      return 0;
    }
    hist[point[i]].insert(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 6000; j++) {
      for (int t : hist[j]) {
        if (point[i] >= 2) {
          point[i] -= 2;
          ans[i][t] = 2;
        } else if (point[i] >= 1 && j >= 1) {
          point[i] -= 1;
          point[t] -= 1;
          ans[i][t] = 1;
        } else {
          if (j < 2) {
            printf("no");
            return 0;
          }
          point[t] -= 2;
        }
      }
      hist[j].clear();
    }
    if (point[i]) {
      printf("no\n");
      return 0;
    }
    for (int j = i + 2; j < n; j++) {
      hist[point[j]].insert(j);
    }
  }
  printf("yes\n");
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j)
        printf("X");
      else if (i < j) {
        if (ans[i][j] == 0) printf("L");
        if (ans[i][j] == 1) printf("D");
        if (ans[i][j] == 2) printf("W");
      } else {
        if (ans[j][i] == 0) printf("W");
        if (ans[j][i] == 1) printf("D");
        if (ans[j][i] == 2) printf("L");
      }
    }
    printf("\n");
  }
}
