#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
const int inf = 1e9 + 7;
const double EPS = 1e-12;
struct point {
  double x, y;
};
struct data {
  int x, id;
};
int n, k;
bool flag;
char a[110][110];
int main() {
  cin >> n >> k;
  if (k == 0) {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) cout << "S";
      cout << endl;
    }
    return 0;
  }
  for (int i = 0; i < n + 5; ++i)
    for (int j = 0; j < n + 5; ++j) a[i][j] = 'S';
  for (int l = 0; l < k; ++l) {
    flag = 0;
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j)
        if (a[i][j] == 'S' && a[i + 1][j] == 'S' && a[i][j + 1] == 'S' &&
            a[i - 1][j] == 'S' && a[i][j - 1] == 'S') {
          a[i][j] = 'L';
          flag = 1;
          break;
        }
      if (flag) break;
    }
    if (!flag) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) cout << a[i][j];
    cout << endl;
  }
  return 0;
}
