Problem: Ostap is preparing to play chess again and this time he is about to prepare. Thus, he was closely monitoring one recent chess tournament. There were m players participating and each pair of players played exactly one game. The victory gives 2 points, draw — 1 points, lose — 0 points.

Ostap is lazy, so he never tries to remember the outcome of each game. Instead, he computes the total number of points earned by each of the players (the sum of his points in all games which he took part in), sort these value in non-ascending order and then remembers first n integers in this list.

Now the Great Strategist Ostap wonders whether he remembers everything correct. He considers that he is correct if there exists at least one tournament results table such that it will produce the given integers. That means, if we count the sum of points for each player, sort them and take first n elements, the result will coincide with what Ostap remembers. Can you check if such table exists?

Input

The first line of the input contains two integers m and n (1 ≤ n ≤ m ≤ 3000) — the number of participants of the tournament and the number of top results Ostap remembers.

The second line contains n integers, provided in non-ascending order — the number of points earned by top participants as Ostap remembers them. It's guaranteed that this integers are non-negative and do not exceed 2·m.

Output

If there is no tournament such that Ostap can obtain the given set of integers using the procedure described in the statement, then print "no" in the only line of the output. Otherwise, the first line of the output should contain the word "yes". Next m lines should provide the description of any valid tournament. Each of these lines must contain m characters 'X', 'W', 'D' and 'L'. Character 'X' should always be located on the main diagonal (and only there), that is on the i-th position of the i-th string. Character 'W' on the j-th position of the i-th string means that the i-th player won the game against the j-th. In the same way character 'L' means loose and 'D' means draw.

The table you print must be consistent and the points earned by best n participants should match the memory of Ostap. If there are many possible answers, print any of them.

Examples

Input

5 5
8 6 4 2 0


Output

yes
XWWWW
LXWWW
LLXWW
LLLXW
LLLLX


Input

5 1
9


Output

no

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
void getre() {
  int x = 0;
  printf("%d\n", 1 / x);
}
void gettle() {
  int res = 1;
  while (1) res <<= 1;
  printf("%d\n", res);
}
template <typename T, typename S>
inline bool upmin(T &a, const S &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T, typename S>
inline bool upmax(T &a, const S &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename N, typename PN>
inline N flo(N a, PN b) {
  return a >= 0 ? a / b : -((-a - 1) / b) - 1;
}
template <typename N, typename PN>
inline N cei(N a, PN b) {
  return a > 0 ? (a - 1) / b + 1 : -(-a / b);
}
template <typename N>
N gcd(N a, N b) {
  return b ? gcd(b, a % b) : a;
}
template <typename N>
inline int sgn(N a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
inline void gn(long long &x) {
  int sg = 1;
  char c;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  c == '-' ? (sg = -1, x = 0) : (x = c - '0');
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= sg;
}
inline void gn(int &x) {
  long long t;
  gn(t);
  x = t;
}
inline void gn(unsigned long long &x) {
  long long t;
  gn(t);
  x = t;
}
inline void gn(double &x) {
  double t;
  scanf("%lf", &t);
  x = t;
}
inline void gn(long double &x) {
  double t;
  scanf("%lf", &t);
  x = t;
}
inline void gs(char *s) { scanf("%s", s); }
inline void gc(char &c) {
  while ((c = getchar()) > 126 || c < 33)
    ;
}
inline void pc(char c) { putchar(c); }
inline long long sqr(long long a) { return a * a; }
inline double sqrf(double a) { return a * a; }
const int inf = 0x3f3f3f3f;
const double pi = 3.14159265358979323846264338327950288L;
const double eps = 1e-6;
int n, m;
int a[6333];
int id[6333];
int presum[6333];
int tot;
int ans[3333][3333];
vector<int> in[6444], out[6444];
int ok[6666];
int tmp[6666], tmpid[6666];
int main() {
  gn(n);
  gn(m);
  for (int i = (1), _ed = (m + 1); i < _ed; i++) gn(a[i]);
  sort(a + 1, a + 1 + m);
  reverse(a + 1, a + 1 + m);
  tot = n * (n - 1);
  for (int i = (1), _ed = (m + 1); i < _ed; i++) {
    presum[i] = a[i] + presum[i - 1];
  }
  if (presum[m] > tot || presum[m] + (n - m) * a[m] < tot) {
    printf("no\n");
    return 0;
  }
  if (m != n) {
    int lef = tot - presum[m];
    int q = lef / (n - m);
    for (int i = (m + 1), _ed = (n + 1); i < _ed; i++) a[i] = q;
    int r = lef % (n - m);
    for (int i = (m + 1), _ed = (m + r + 1); i < _ed; i++) a[i]++;
  }
  int su = 0;
  for (int i = 1; i <= n; i++) {
    su += a[n - i + 1];
    if (su < i * (i - 1)) {
      printf("no\n");
      return 0;
    }
  }
  printf("yes\n");
  for (int i = (1), _ed = (n + 1); i < _ed; i++) id[i] = i;
  for (int i = (1), _ed = (n); i < _ed; i++) {
    memset(ok, 0, sizeof(ok));
    int fen = a[i];
    int lef = n - i;
    for (int j = (0), _ed = (2 * (n - i + 1) + 1); j < _ed; j++) in[j].clear();
    for (int j = (i + 1), _ed = (n + 1); j < _ed; j++) {
      in[a[j]].push_back(j);
    }
    int curma = a[i + 1];
    fen = 2 * lef - fen;
    while (fen) {
      while (in[curma].empty()) curma--;
      int x = in[curma].back();
      in[curma].pop_back();
      if (ok[x] != 2) {
        ok[x]++;
        fen--;
        in[curma - 1].push_back(x);
      } else {
        out[curma].push_back(x);
      }
    }
    for (int j = (i + 1), _ed = (n + 1); j < _ed; j++) {
      ans[id[i]][id[j]] = ok[j];
      ans[id[j]][id[i]] = 2 - ok[j];
    }
    int tmptot = 0;
    for (int j = a[i + 1]; j >= 0; j--) {
      while (!in[j].empty()) {
        int x = in[j].back();
        in[j].pop_back();
        tmp[++tmptot] = x;
        a[tmptot + i] = j;
      }
      while (!out[j].empty()) {
        int x = out[j].back();
        out[j].pop_back();
        tmp[++tmptot] = x;
        a[tmptot + i] = j;
      }
    }
    for (int t = (1), _ed = (tmptot + 1); t < _ed; t++) {
      tmpid[t + i] = id[tmp[t]];
    }
    for (int t = (1), _ed = (tmptot + 1); t < _ed; t++) {
      id[t + i] = tmpid[t + i];
    }
  }
  for (int i = (1), _ed = (n + 1); i < _ed; i++) {
    for (int j = (1), _ed = (n + 1); j < _ed; j++) {
      if (i == j)
        putchar('X');
      else if (ans[i][j] == 2)
        putchar('L');
      else if (ans[i][j] == 1)
        putchar('D');
      else
        putchar('W');
    }
    putchar('\n');
  }
  return 0;
}