#include <bits/stdc++.h>
bool land_it(std::vector<std::string>& f) {
  for (int i = 0; i < f.size(); ++i) {
    for (int j = 0; j < f[0].size(); ++j) {
      if (f[i][j] == 'S') {
        f[i][j] = 'L';
        if (i + 1 < f.size()) f[i + 1][j] = 'O';
        if (i - 1 >= 0) f[i - 1][j] = 'O';
        if (j + 1 < f[0].size()) f[i][j + 1] = 'O';
        if (j - 1 >= 0) f[i][j - 1] = 'O';
        return true;
      }
    }
  }
  return false;
}
int main() {
  int n, k;
  std::cin >> n >> k;
  std::vector<std::string> f(n, std::string(n, 'S'));
  for (int i = 0; i < k; ++i) {
    bool r = land_it(f);
    if (!r) {
      std::cout << "NO\n";
      return 0;
    }
  }
  std::cout << "YES\n";
  for (int i = 0; i < f.size(); ++i) {
    for (int j = 0; j < f[0].size(); ++j) {
      if (f[i][j] == 'O') f[i][j] = 'S';
    }
    std::cout << f[i] << "\n";
  }
  return 0;
}
