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;
constexpr long long mod = 1000000007;
const long long INF = mod * mod;
const double eps = 1e-12;
const double pi = acos(-1.0);
long long mod_pow(long long x, long long n, long long m = mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % m;
    x = x * x % m;
    n >>= 1;
  }
  return res;
}
struct modint {
  long long n;
  modint() : n(0) { ; }
  modint(long long m) : n(m) {
    if (n >= mod)
      n %= mod;
    else if (n < 0)
      n = (n % mod + mod) % mod;
  }
  operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) {
  a.n += b.n;
  if (a.n >= mod) a.n -= mod;
  return a;
}
modint operator-=(modint& a, modint b) {
  a.n -= b.n;
  if (a.n < 0) a.n += mod;
  return a;
}
modint operator*=(modint& a, modint b) {
  a.n = ((long long)a.n * b.n) % mod;
  return a;
}
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, long long n) {
  if (n == 0) return modint(1);
  modint res = (a * a) ^ (n / 2);
  if (n % 2) res = res * a;
  return res;
}
long long inv(long long a, long long p) {
  return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init_f() {
  fact[0] = modint(1);
  for (int i = 0; i < max_n - 1; i++) {
    fact[i + 1] = fact[i] * modint(i + 1);
  }
  factinv[max_n - 1] = modint(1) / fact[max_n - 1];
  for (int i = max_n - 2; i >= 0; i--) {
    factinv[i] = factinv[i + 1] * modint(i + 1);
  }
}
modint comb(int a, int b) {
  if (a < 0 || b < 0 || a < b) return 0;
  return fact[a] * factinv[b] * factinv[a - b];
}
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  while (b) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
struct edge {
  int to;
  int cap;
  int rev;
};
struct Dinic {
 private:
  int n;
  vector<int> dist, iter;

 public:
  vector<vector<edge>> v;
  Dinic(int sz) : n(sz), v(sz), dist(sz), iter(sz) {}
  void add_edge(int from, int to, int cap, int dec = 0) {
    int x = v[to].size(), y = v[from].size();
    v[from].push_back({to, cap - dec, x});
    v[to].push_back({from, dec, y});
  }
  void bfs(int s) {
    fill(dist.begin(), dist.end(), -1);
    queue<int> q;
    dist[s] = 0;
    q.push(s);
    while (q.size()) {
      int x = q.front();
      q.pop();
      for (int i = 0; i < v[x].size(); i++) {
        edge& e = v[x][i];
        if (e.cap > 0 && dist[e.to] < 0) {
          dist[e.to] = dist[x] + 1;
          q.push(e.to);
        }
      }
    }
  }
  int dfs(int x, int t, int f) {
    if (x == t) return f;
    for (int& i = iter[x]; i < (int)v[x].size(); ++i) {
      edge& e = v[x][i];
      if (e.cap > 0 && dist[x] < dist[e.to]) {
        int d = dfs(e.to, t, min(f, e.cap));
        if (d > 0) {
          e.cap -= d;
          v[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }
  int max_flow(int s, int t) {
    int flow = 0;
    while (1) {
      bfs(s);
      if (dist[t] < 0) return flow;
      fill(iter.begin(), iter.end(), 0);
      int f;
      while ((f = dfs(s, t, 1 << 30)) > 0) flow += f;
    }
  }
};
string ans[3000];
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  int sum = 0;
  for (int i = 0; i < m; i++) {
    a[i] -= (n - 1);
    sum += a[i];
  }
  int ma = (n - m) * a.back() + sum;
  if (ma < 0) {
    cout << "no\n";
    return;
  }
  for (int i = 0; i < n - m; i++) {
    int x = sum + (n - m - 1 - i) * a[m - 1];
    if (n - 1 - 2 * i > 0) x = min(x, n - 1 - 2 * i);
    a.push_back(-x);
    sum -= x;
  }
  sort((a).begin(), (a).end());
  for (int i = 0; i < n; i++) ans[i].resize(n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i == j)
        ans[i][j] = 'X';
      else
        ans[i][j] = 'D';
    }
  vector<int> cnt(n);
  for (int i = 0; i < n; i++) cnt[i] = a[i];
  vector<bool> used(n);
  for (int i = 0; i < n; i++) {
    vector<pair<int, int>> v;
    for (int j = 0; j < n; j++) {
      if (used[j]) continue;
      v.push_back({cnt[j], j});
    }
    sort((v).begin(), (v).end());
    if (v[0].first < -(n - 1 - i) || v.back().first > n - 1 - i) {
      cout << "no\n";
      return;
    }
    int id = 0;
    if (v[0].first + n - 1 - i < n - 1 - v.back().first) {
      id = v[0].second;
      for (int j = 0; j < -cnt[id]; j++) {
        int to = v[v.size() - 1 - j].second;
        ans[id][to] = 'L';
        ans[to][id] = 'W';
        cnt[to]--;
      }
      used[id] = true;
    } else {
      id = v.back().second;
      for (int j = 0; j < cnt[id]; j++) {
        int to = v[j].second;
        ans[id][to] = 'W';
        ans[to][id] = 'L';
        cnt[to]++;
      }
      used[id] = true;
    }
  }
  cout << "yes\n";
  for (int i = 0; i < n; i++) cout << ans[i] << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}