#include <bits/stdc++.h>
using namespace std;
int array1[1000][1000];
int main() {
  int n, k, xx = 1;
  memset(array1, -1, sizeof(array1));
  cin >> n >> k;
  if (k == 0) {
    printf("YES\n");
    for (int ii = 0; ii < n; ii++) {
      for (int jj = 0; jj < n; jj++) {
        printf("S");
      }
      printf("\n");
    }
  } else {
    array1[0][0] = 1;
    for (int ii = 0; ii < n; ii++) {
      for (int jj = 0; jj < n; jj++) {
        if (array1[ii][jj] == 1) {
          array1[ii][jj] == 1;
        } else if (array1[ii][jj - 1] == 1 || array1[ii - 1][jj] == 1) {
          array1[ii][jj] = 0;
        } else {
          array1[ii][jj] = 1;
          xx++;
        }
        if (xx == k) {
          ii = n + 1;
          jj = n + 1;
        }
      }
    }
    if (xx < k)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int ii = 0; ii < n; ii++) {
        for (int jj = 0; jj < n; jj++) {
          if (array1[ii][jj] == 1) {
            printf("L");
          } else {
            printf("S");
          }
        }
        printf("\n");
      }
      printf("\n");
    }
  }
  return 0;
}
