#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<vector<char> > arr(n, vector<char>(n, 'S'));
  for (int i = 0; i < n; i++)
    for (int j = (i % 2); j < n; j += 2) {
      if (k > 0) {
        if (k == 1) {
          arr[i][j] = 'L';
          if (i < n - 1) {
            for (int h = j + 2; h < n; h += 2) {
              arr[i][h] = 'L';
            }
            if (i == 0)
              for (int h = j + 1; h < n; h++) arr[i][h] = 'L';
          }
          for (int g = i + 1; g < n; g++)
            for (int h = j; h < n; h++) {
              arr[g][h] = 'L';
              if (h == 1 && g > i) arr[g][h - 1] = 'L';
            }
        } else if (k <= ((n - j) / 2 + (n - j) % 2)) {
          for (int g = i; g < n; g++) {
            arr[g][j] = 'L';
            if (j == 1 && g > i) arr[g][j - 1] = 'L';
          }
        } else
          arr[i][j] = 'L';
        k--;
      }
    }
  if (k > 0) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << arr[i][j];
    cout << endl;
  }
  return 0;
}
