#include <bits/stdc++.h>
int num[3001];
char res[3001][3001];
int main() {
  int n, m;
  scanf("%d%d", &m, &n);
  int tot = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num[i]);
    tot = tot + num[i];
  }
  int sum = m * (m - 1);
  int ress = sum - tot;
  if (ress < 0 || (ress && n == m))
    printf("no\n");
  else {
    if (m != n) {
      int point = ress / (m - n);
      int plusnum = ress % (m - n);
      for (int i = n + 1; i <= n + plusnum; i++) {
        num[i] = point + 1;
      }
      for (int i = n + plusnum + 1; i <= m; i++) {
        num[i] = point;
      }
    }
    if (m != n && num[n + 1] > num[n])
      printf("no\n");
    else {
      int ok = 1;
      for (int i = 1; i <= m; i++) {
        if (num[i] > 2 * (m - i)) {
          ok = 0;
          break;
        }
        int dif = 2 * (m - i) - num[i];
        int nowflag = i + 1, last = i;
        while (dif) {
          while (nowflag < m && num[nowflag + 1] == num[nowflag]) nowflag++;
          for (int j = nowflag; j > last && dif; j--) {
            res[i][j] = 'D';
            num[j]--;
            dif--;
          }
          last = nowflag;
          nowflag++;
        }
      }
      if (!ok)
        printf("no\n");
      else {
        printf("yes\n");
        for (int i = 1; i <= m; i++) {
          for (int j = 1; j <= m; j++) {
            if (i == j)
              printf("X");
            else if (i < j) {
              if (res[i][j] == 'D')
                printf("D");
              else
                printf("W");
            } else {
              if (res[j][i] == 'D')
                printf("D");
              else
                printf("L");
            }
          }
          printf("\n");
        }
      }
    }
  }
  return 0;
}
