#include <bits/stdc++.h>
using namespace std;
char **grid;
int n;
const int iTop = 1, iBottom = 2, iLeft = 3, iRight = 4;
bool isAvailable(int i, int j, int parent) {
  if (grid[i][j] == 'L') return false;
  bool top = true, bottom = true, left = true, right = true;
  if (i - 1 >= 0 && parent != iTop) {
    if (grid[i - 1][j] == 'L') top = false;
  }
  if (i + 1 < n) {
    if (grid[i + 1][j] == 'L' && parent != iBottom) bottom = false;
  }
  if (j - 1 >= 0) {
    if (grid[i][j - 1] == 'L' && parent != iLeft) left = false;
  }
  if (j + 1 < n) {
    if (grid[i][j + 1] == 'L' && parent != iRight) right = false;
  }
  return (top && bottom && left && right);
}
void mark_land(int x, int y) {
  if (x - 1 >= 0) {
    if (isAvailable(x - 1, y, iBottom)) {
      grid[x - 1][y] = 'L';
      mark_land(x - 1, y);
    }
  }
  if (x + 1 < n) {
    if (isAvailable(x + 1, y, iTop)) {
      grid[x + 1][y] = 'L';
      mark_land(x + 1, y);
    }
  }
  if (y - 1 >= 0) {
    if (isAvailable(x, y - 1, iRight)) {
      grid[x][y - 1] = 'L';
      mark_land(x, y - 1);
    }
  }
  if (y + 1 < n) {
    if (isAvailable(x, y + 1, iLeft)) {
      grid[x][y + 1] = 'L';
      mark_land(x, y + 1);
    }
  }
}
int main() {
  int k;
  cin >> n >> k;
  int fields = n * n;
  int res = fields % 2 == 0 ? fields / 2 : ((fields + 1) / 2);
  if (k > res) {
    cout << "NO";
  } else {
    grid = new char *[n];
    for (int i = 0; i < n; ++i) {
      grid[i] = new char[n];
      for (int j = 0; j < n; ++j) {
        grid[i][j] = 'S';
      }
    }
    pair<int, int> points[k];
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (cnt == k) break;
        bool top = true, bottom = true, left = true, right = true;
        if (i - 1 >= 0) {
          if (grid[i - 1][j] == 'L') top = false;
        }
        if (i + 1 < n) {
          if (grid[i + 1][j] == 'L') bottom = false;
        }
        if (j - 1 >= 0) {
          if (grid[i][j - 1] == 'L') left = false;
        }
        if (j + 1 < n) {
          if (grid[i][j + 1] == 'L') right = false;
        }
        if (top && bottom && left && right) {
          points[cnt] = make_pair(i, j);
          grid[i][j] = 'L';
          ++cnt;
        }
      }
      if (cnt == k) break;
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        cout << grid[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
