import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Set;
import java.util.TreeSet;

public class B {
  public static void main(String args[]){
    MyScanner scan = new MyScanner();
    int n, k;
    n = scan.nextInt();
    k = scan.nextInt();
    char canvas[][] = new char[n][n];
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++)canvas[i][j]='S';
    }
    int totol_cells = n*n;
    if((totol_cells%2==0 && k>totol_cells/2) || ((totol_cells%2==1 && k > (totol_cells/2)+1))){
      System.out.println("NO");
      return;
    }

    int island_count = 0;
    for(int i=0; i<n; i++){
      if(island_count==k) continue;
      for(int j=0; j<n; j++){
        if((i+j)%2==0){
          canvas[i][j]='L';
          island_count++;
          if(island_count==k) break;
        }
      }
    }
    System.out.println("YES");
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++)System.out.print(canvas[i][j]);
      System.out.println();
    }

  }
}
class MyScanner
  {
      private byte[] buf = new byte[1024];
      private int curChar;
      private int numChars;
      BufferedInputStream bis = new BufferedInputStream(System.in);

      public int read()
      {
          if (-1 == numChars)
          {
            throw new InputMismatchException();
          }
          if (curChar >= numChars)
          {
              curChar = 0;
              try
              {
                  numChars = bis.read(buf);
              }
              catch (IOException e)
              {
                  throw new InputMismatchException();
              }
              if (numChars <= 0)
              {
                return -1;
              }
          }
          return buf[curChar++];
      }

      public int nextInt()
      {
          int c = read();
          while (isSpaceChar(c))
          {
            c = read();
          }
          int sgn = 1;
          if (c == '-')
          {
              sgn = -1;
              c = read();
          }
          int res = 0;
          do
          {
              if (c < '0' || c > '9')
              {
                throw new InputMismatchException();
              }
              res *= 10;
              res += c - '0';
              c = read();
          } while (!isSpaceChar(c));
          return res * sgn;
      }

      public long nextLong()
      {
        int c = read();
        while (isSpaceChar(c))
        {
          c = read();
        }
        int sgn = 1;
        if (c == '-')
        {
          sgn = -1;
          c = read();
        }
        long res = 0;
        do
        {
          if (c < '0' || c > '9')
          {
            throw new InputMismatchException();
          }
          res *= 10;
          res += c - '0';
          c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
      }

      public String next()
      {
          int c = read();
          while (isSpaceChar(c))
          {
            c = read();
          }
          StringBuilder res = new StringBuilder();
          do
          {
              res.appendCodePoint(c);
              c = read();
          } while (!isSpaceChar(c));
          return res.toString();
      }

      private boolean isSpaceChar(int c)
      {
          return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
      }
  }


import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Set;
import java.util.TreeSet;

public class B {
  public static void main(String args[]){
    MyScanner scan = new MyScanner();
    int n, k;
    n = scan.nextInt();
    k = scan.nextInt();
    char canvas[][] = new char[n][n];
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++)canvas[i][j]='S';
    }
    int totol_cells = n*n;
    if((totol_cells%2==0 && k>totol_cells/2) || ((totol_cells%2==1 && k > (totol_cells/2)+1))){
      System.out.println("NO");
      return;
    }

    int island_count = 0;
    for(int i=0; i<n; i++){
      if(island_count==k) continue;
      for(int j=0; j<n; j++){
        if((i+j)%2==0){
          canvas[i][j]='L';
          island_count++;
          if(island_count==k) break;
        }
      }
    }
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++)System.out.print(canvas[i][j]);
      System.out.println();
    }

  }
}
class MyScanner
  {
      private byte[] buf = new byte[1024];
      private int curChar;
      private int numChars;
      BufferedInputStream bis = new BufferedInputStream(System.in);

      public int read()
      {
          if (-1 == numChars)
          {
            throw new InputMismatchException();
          }
          if (curChar >= numChars)
          {
              curChar = 0;
              try
              {
                  numChars = bis.read(buf);
              }
              catch (IOException e)
              {
                  throw new InputMismatchException();
              }
              if (numChars <= 0)
              {
                return -1;
              }
          }
          return buf[curChar++];
      }

      public int nextInt()
      {
          int c = read();
          while (isSpaceChar(c))
          {
            c = read();
          }
          int sgn = 1;
          if (c == '-')
          {
              sgn = -1;
              c = read();
          }
          int res = 0;
          do
          {
              if (c < '0' || c > '9')
              {
                throw new InputMismatchException();
              }
              res *= 10;
              res += c - '0';
              c = read();
          } while (!isSpaceChar(c));
          return res * sgn;
      }

      public long nextLong()
      {
        int c = read();
        while (isSpaceChar(c))
        {
          c = read();
        }
        int sgn = 1;
        if (c == '-')
        {
          sgn = -1;
          c = read();
        }
        long res = 0;
        do
        {
          if (c < '0' || c > '9')
          {
            throw new InputMismatchException();
          }
          res *= 10;
          res += c - '0';
          c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
      }

      public String next()
      {
          int c = read();
          while (isSpaceChar(c))
          {
            c = read();
          }
          StringBuilder res = new StringBuilder();
          do
          {
              res.appendCodePoint(c);
              c = read();
          } while (!isSpaceChar(c));
          return res.toString();
      }

      private boolean isSpaceChar(int c)
      {
          return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
      }
  }


import java.util.Scanner;

public class B544 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int poss = (int) Math.ceil((double) n * n / 2);
		if (k > poss)

			System.out.println("NO");
		else {
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if((i+j)%2==0 && k>0){
						System.out.print("L");
						k--;
					}else{
						System.out.print("S");
					}

				}
				System.out.println();
			}
		}

	}
}


import java.util.Scanner;

public class B544 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int poss = (int) Math.ceil((double) n * n / 2);
		if (k > poss)

			System.out.println("NO");
		else {
			System.out.println("YES");
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if((i+j)%2==0 && k>0){
						System.out.print("L");
						k--;
					}else{
						System.out.print("S");
					}

				}
				System.out.println();
			}
		}

	}
}


import java.util.Scanner;

public class TaskB {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    solve(in);
  }

  public static void solve(Scanner in) {
    int n = in.nextInt();
    int k = in.nextInt();
    int max;
    if (n % 2 == 0) max = (n * n) / 2;
    else max = (n * n) / 2 + 1;
    if (k > max) {
      System.out.println("NO");
      return;
    }
    System.out.println("YES");
    int count = k;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if ((i % 2 == j % 2) && count > 0) {
          System.out.print("L");
          count--;
        } else {
          System.out.print("S");
        }
      }
      System.out.println();
    }
  }
}


import java.util.Scanner;

public class TaskB {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    solve(in);
  }

  public static void solve(Scanner in) {
    int n = in.nextInt();
    int k = in.nextInt();
    int max;
    if (n % 2 == 0) max = (n * n) / 2;
    else max = (n * n) / 2 + 1;
    if (k > max) {
      System.out.println("NO");
      return;
    }
    int count = k;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if ((i % 2 == j % 2) && count > 0) {
          System.out.print("L");
          count--;
        } else {
          System.out.print("S");
        }
      }
      System.out.println();
    }
  }
}


import java.util.Scanner;
public class Main {
	public static void main(String[]args){
		Scanner sc=new Scanner(System.in);
		String whole = sc.nextLine();
		String num="";String kay="";int index=0;
		for(int i=0;i<whole.length();i++){
			if(whole.charAt(i)==' '){
				index=i;break;
			}
			else{
				num += ""+whole.charAt(i);
			}
		}
		for(int j=index+1;j<whole.length();j++){
			kay+="" +whole.charAt(j);
		}

		int n=Integer.parseInt(num);
		int k=Integer.parseInt(kay);
		if(k<= ((n*n)+1)/2){
			System.out.println("YES");

			for(int i =1;i<=n;i++){
				for(int j=1;j<=n;j++){
					if((i+j)%2==0 && k>0){
						System.out.print("L");
						k--;
					}
					else{
						System.out.print("S");
					}

				}
				System.out.println();
			}
		}
		else{
			System.out.println("NO");
		}
	}

}


import java.io.*;
public class Main {
	public static void main(String[]args) throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		int n= Integer.parseInt(bf.readLine());
		int k=Integer.parseInt(bf.readLine());
		if(k<= (n*n)/2){
			System.out.println("YES");

			for(int i =1;i<=n;i++){
				for(int j=1;j<=n;j++){
					if((i+j)%2==0 && k>0){
						System.out.print("L");
						k--;
					}
					else{
						System.out.print("S");
					}

				}
				System.out.println();
			}
		}
		else{
			System.out.println("NO");
		}
	}

}


import java.util.Scanner;
public class Main{
	public static void main(String[]args){
		Scanner sc=new Scanner(System.in);
		String whole = sc.nextLine();
		String num="";String kay="";int index=0;
		for(int i=0;i<whole.length();i++){
			if(whole.charAt(i)==' '){
				index=i;break;
			}
			else{
				num += ""+whole.charAt(i);
			}
		}
		for(int j=index+1;j<whole.length();j++){
			kay+="" +whole.charAt(j);
		}

		int n=Integer.parseInt(num);
		int k=Integer.parseInt(kay);
		if(k<= (n*n)/2){
			System.out.println("YES");

			for(int i =1;i<=n;i++){
				for(int j=1;j<=n;j++){
					if((i+j)%2==0 && k>0){
						System.out.print("L");
						k--;
					}
					else{
						System.out.print("S");
					}

				}
				System.out.println();
			}
		}
		else{
			System.out.println("NO");
		}
	}

}


import java.util.*;

public class P544_B {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int n,islands;
        Scanner scan = new Scanner(System.in);
        n=scan.nextInt();
        islands=scan.nextInt();
        if((islands>((n*n)+1)/2) || (islands==0 && n==1)){
            System.out.println("NO");
        }
        else{
            System.out.println("YES");
            char map[][]=new char[n][n];
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    map[i][j]='S';
                }
            }
            int count=0;
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    if((i%2==0 && j%2==0) || (i%2==1 && j%2==1)){
                        map[i][j]='L';
                        count++;
                    }
                    if(count==islands){
                        break;

                    }
                }
                if(count==islands){
                    break;
                }

            }
            for(int i=0;i<n;i++){
                System.out.println(map[i]);
            }
        }
        scan.close();
    }

}


import java.util.*;

public class P544_B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int n,islands;
		Scanner scan = new Scanner(System.in);
		n=scan.nextInt();
		islands=scan.nextInt();
		if((islands>((n*n)+1)/2)){
			System.out.println("NO");
		}
		else{
			System.out.println("YES");
			char map[][]=new char[n][n];
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					map[i][j]='S';
				}
			}
			int count=0;
			for(int i=0;i<n;i++){
				if(count==islands){
					break;
				}
				for(int j=0;j<n;j++){
					if((i%2==0 && j%2==0) || (i%2==1 && j%2==1)){
						map[i][j]='L';
						count++;
					}
					if(count==islands){
						break;

					}
				}

			}
			for(int i=0;i<n;i++){
				System.out.println(map[i]);
			}
		}
		scan.close();
	}

}


import java.util.*;

public class P544_B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int n,islands;
		Scanner scan = new Scanner(System.in);
		n=scan.nextInt();
		islands=scan.nextInt();
		if(islands>((n*n)+1)/2){
			System.out.println("NO");
		}
		else{
			System.out.println("YES");
			char map[][]=new char[n][n];
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					map[i][j]='S';
				}
			}
			int count=0;
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					if((i%2==0 && j%2==0) || (i%2==1 && j%2==1)){
						map[i][j]='L';
						count++;
					}
					if(count==islands){
						break;

					}
				}
				if(count==islands){
					break;
				}

			}
			for(int i=0;i<n;i++){
				System.out.println(map[i]);
			}
		}
		scan.close();
	}

}


import java.io.*;
import java.util.*;
public class Problem544B
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      if(k>(n*n/2)) System.out.println("NO");

      else{
         System.out.println("YES");
         int count = 0;
         char[][] arr = new char[n][n];

         for(int i=0; i<n; i++)
            for(int j=0; j<n; j++)
               arr[i][j]='S';
         for(int i=0; i<n; i++)
         {
            for(int j=i%2; j<n; j+=2)
            {
               if(count<k)
               {
                  arr[i][j]='L';
                  count++;
               }
            }
         }
         for(int i=0; i<n; i++){
            for(int j=0; j<n; j++)
            {
               System.out.print(arr[i][j]);
            }
            System.out.println();
         }
      }
   }

}


import java.io.*;
import java.util.*;
public class Problem544B
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      if(k>((n*n+1)/2)) System.out.println("NO");

      else{
         System.out.println("YES");
         int count = 0;
         char[][] arr = new char[n][n];

         for(int i=0; i<n; i++)
            for(int j=0; j<n; j++)
               arr[i][j]='S';
         for(int i=0; i<n; i++)
         {
            for(int j=i%2; j<n; j+=2)
            {
               if(count<k)
               {
                  arr[i][j]='L';
                  count++;
               }
            }
         }
         for(int i=0; i<n; i++){
            for(int j=0; j<n; j++)
            {
               System.out.print(arr[i][j]);
            }
            System.out.println();
         }
      }
   }

}


import java.io.*;
import java.util.*;
public class Problem544B
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      if(k>(n*n/2)) System.out.println("NO");

      else{
         int count = 0;
         char[][] arr = new char[n][n];

         for(int i=0; i<n; i++)
            for(int j=0; j<n; j++)
               arr[i][j]='S';
         for(int i=0; i<n; i++)
         {
            for(int j=i%2; j<n; j+=2)
            {
               if(count<k)
               {
                  arr[i][j]='L';
                  count++;
               }
            }
         }
         for(int i=0; i<n; i++){
            for(int j=0; j<n; j++)
            {
               System.out.print(arr[i][j]);
            }
            System.out.println();
         }
      }
   }

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class sand_and_island
{

    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;

        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }

        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }

      public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }

        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }

        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }

        }
        public String readLine() throws IOException{
            return s.readLine();
        }

        public void close() throws IOException{
            s.close();
        }

    }
     private static FastScanner s = new FastScanner();
     private static PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));

      static int count=0;
     public static void main(String[] args) throws IOException
     {
        int n=s.nextInt();int size=n;
        int k=s.nextInt();
        int temp=(n%2==0)?(n*n)/2:((n*n)/2)+1;
        if(k>temp)
             System.out.println("NO");
        else
        {
            System.out.println("YES");
            String[] my = new String[n];boolean arc=false;
            char[] ch = new char[n];
            String fill = new String(ch).replace('\0','S').toString();
           // System.out.println("fill  "+fill);
            for(int i=0;i<n;i++)
            {
                my[i]=fill;
            }
            for(int i=0;i<n;i++)
            {

                if(i%2==0)
                {
                    StringBuffer sb = new StringBuffer(my[i]);
                    for(int j=0;j<n;j=j+2)
                    {
                        if(k==0)     {arc=true;break;}
                        sb.setCharAt(j, 'L');k--;  if(k==0)     {arc=true;break;}
                    }
                    my[i]=sb.toString();
                }
                else
                {
                     StringBuffer sb = new StringBuffer(my[i]);
                    for(int j=1;j<n;j=j+2)
                    {
                        if(k==0){arc=true;break;}
                        sb.setCharAt(j, 'L');k--;
                    }
                    my[i]=sb.toString();

                }
                if(arc)break;
            }
            for(int j=0;j<n;j++)
            {
                System.out.println(""+my[j]);
            }

        }

         s.close();
         ww.close();
     }
     public static int gcd(int a, int b){
        return b == 0 ? a : gcd(b,a%b);
    }

}
/*zabardast swappimng of sorting
/*
    Arrays.sort(m, new Comparator<int[]>() {
                        @Override
                        public int compare(int[] int1, int[] int2)
                        {
                            Integer number1 = int1[1];
                            Integer number2 = int2[1];
                            return number1.compareTo(number2);
                        }
                         });
*/
/*
static final Point getMinMax(int[] array) {
        int min = array[0];
        int max = array[0];

        for (int index = 0, size = array.length; index < size; ++index, ++index) {
            int value = array[index];

            if (index == size - 1) {
                min = min(min, value);
                max = max(max, value);
            } else {
                int otherValue = array[index + 1];

                if (value <= otherValue) {
                    min = min(min, value);
                    max = max(max, otherValue);
                } else {
                    min = min(min, otherValue);
                    max = max(max, value);
                }
            }
        }

        return new Point(min, max);
    }

*/
/*

/// Demonstrate several Is... methods.
class IsDemo {
public static void main(String args[]) {
char a[] = {'a', 'b', '5', '?', 'A', ' '};
for(int i=0; i<a.length; i++) {
if(Character.isDigit(a[i]))                                   ///check if digit is present in string
System.out.println(a[i] + " is a digit.");
if(Character.isLetter(a[i]))
    System.out.println(num + " in binary: " +
Integer.toBinaryString(num));
System.out.println(num + " in octal: " +
Integer.toOctalString(num));
System.out.println(num + " in hexadecimal: " +
Integer.toHexString(num));
}
}
*/
/*
private static void findSubsets(int array[])
{
  int numOfSubsets = 1 << array.length;

  for(int i = 0; i < numOfSubsets; i++)
 {
    int pos = array.length - 1;                                /////bitmask to find all sub sets
   int bitmask = i;

   System.out.print("{");
   while(bitmask > 0)
   {
    if((bitmask & 1) == 1)
     System.out.print(array[pos]+",");
    bitmask >>= 1;
    pos--;
   }
   System.out.print("}");
 }
}
*/

/*   no of DIVISORSSSSSS
 public ArrayList<Integer> get(int x){
            ArrayList<Integer> divisors = new ArrayList<>();
            for(int i = 1; i * i <= x; i++){
                if(x % i == 0){
                    divisors.add(i);
                    if(i * i != x){
                        divisors.add( x / i);
                    }
                }
            }

*/
/*  //// find sum of multiple of a value below limit// ----> (l*(n+1))/2
  public static long getSequenceSum(long value, long limit) {
long q = (limit - 1) / value;
long ans = ((value*q)*(1+q) )/ 2;
return ans;
}
*/
/*// largest prime factor of a no
 public static long largestPrimeFactor(long n) {

        // largest composite factor must be smaller than sqrt
        long sqrt = (long)Math.ceil(Math.sqrt((double)n));

        long largest = -1;

        for(long i = 2; i <= sqrt; i++) {
            if(n % i == 0) {
                long test = largestPrimeFactor(n/i);
                if(test > largest) {
                    largest = test;
                }
            }
        }

        if(largest != -1) {
            return largest;
        }

        // number is prime
        return n;
    }
*/
/*    // prime no using sieve of erostheneses
  public static void prime()
{
  boolean[] isPrime = new boolean[100000000+ 1];
         Arrays.fill(isPrime, true);

        // mark non-primes <= N using Sieve of Eratosthenes
        for (int i = 2; i*i <= 100000000; i++)
        {

             if (isPrime[i])
             {
                for (int j = i; i*j <= 100000000; j++) {
                    isPrime[i*j] = false;
                }
            }
        }
}

*/
/*//// largest common sequences
 public String lcs(String str1, String str2)
    {
        int l1 = str1.length();
        int l2 = str2.length();

        int[][] arr = new int[l1 + 1][l2 + 1];

        for (int i = l1 - 1; i >= 0; i--)
        {
            for (int j = l2 - 1; j >= 0; j--)
            {
                if (str1.charAt(i) == str2.charAt(j))
                    arr[i][j] = arr[i + 1][j + 1] + 1;
                else
                    arr[i][j] = Math.max(arr[i + 1][j], arr[i][j + 1]);
            }
        }

        int i = 0, j = 0;
        StringBuffer sb = new StringBuffer();
        while (i < l1 && j < l2)

 {
            if (str1.charAt(i) == str2.charAt(j))
            {
                sb.append(str1.charAt(i));
                i++;
                j++;
            }
            else if (arr[i + 1][j] >= arr[i][j + 1])
                i++;
            else
                j++;
        }
        return sb.toString();
    }

*/


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class sand_and_island
{

    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;

        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }

        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }

      public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }

        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }

        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }

        }
        public String readLine() throws IOException{
            return s.readLine();
        }

        public void close() throws IOException{
            s.close();
        }

    }
     private static FastScanner s = new FastScanner();
     private static PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));

      static int count=0;
     public static void main(String[] args) throws IOException
     {
        int n=s.nextInt();int size=n;
        int k=s.nextInt();
        if(k>n/2 && n%2==0 || k>n/2+1 && n%2!=0)
             System.out.println("NO");
        else
        {
            System.out.println("YES");
            String[] my = new String[n];boolean arc=false;
            char[] ch = new char[n];
            String fill = new String(ch).replace('\0','S').toString();
           // System.out.println("fill  "+fill);
            for(int i=0;i<n;i++)
            {
                my[i]=fill;
            }
            for(int i=0;i<n;i++)
            {

                if(i%2==0)
                {
                    StringBuffer sb = new StringBuffer(my[i]);
                    for(int j=0;j<n;j=j+2)
                    {
                        sb.setCharAt(j, 'L');k--;  if(k==0)     {arc=true;break;}
                    }
                    my[i]=sb.toString();
                }
                else
                {
                     StringBuffer sb = new StringBuffer(my[i]);
                    for(int j=1;j<n;j=j+2)
                    {
                        sb.setCharAt(j, 'L');k--; if(k==0){arc=true;break;}
                    }
                    my[i]=sb.toString();

                }
                if(arc)break;
            }
            for(int j=0;j<n;j++)
            {
                System.out.println(""+my[j]);
            }

        }

         s.close();
         ww.close();
     }
     public static int gcd(int a, int b){
        return b == 0 ? a : gcd(b,a%b);
    }

}
/*zabardast swappimng of sorting
/*
    Arrays.sort(m, new Comparator<int[]>() {
                        @Override
                        public int compare(int[] int1, int[] int2)
                        {
                            Integer number1 = int1[1];
                            Integer number2 = int2[1];
                            return number1.compareTo(number2);
                        }
                         });
*/
/*
static final Point getMinMax(int[] array) {
        int min = array[0];
        int max = array[0];

        for (int index = 0, size = array.length; index < size; ++index, ++index) {
            int value = array[index];

            if (index == size - 1) {
                min = min(min, value);
                max = max(max, value);
            } else {
                int otherValue = array[index + 1];

                if (value <= otherValue) {
                    min = min(min, value);
                    max = max(max, otherValue);
                } else {
                    min = min(min, otherValue);
                    max = max(max, value);
                }
            }
        }

        return new Point(min, max);
    }

*/
/*

/// Demonstrate several Is... methods.
class IsDemo {
public static void main(String args[]) {
char a[] = {'a', 'b', '5', '?', 'A', ' '};
for(int i=0; i<a.length; i++) {
if(Character.isDigit(a[i]))                                   ///check if digit is present in string
System.out.println(a[i] + " is a digit.");
if(Character.isLetter(a[i]))
    System.out.println(num + " in binary: " +
Integer.toBinaryString(num));
System.out.println(num + " in octal: " +
Integer.toOctalString(num));
System.out.println(num + " in hexadecimal: " +
Integer.toHexString(num));
}
}
*/
/*
private static void findSubsets(int array[])
{
  int numOfSubsets = 1 << array.length;

  for(int i = 0; i < numOfSubsets; i++)
 {
    int pos = array.length - 1;                                /////bitmask to find all sub sets
   int bitmask = i;

   System.out.print("{");
   while(bitmask > 0)
   {
    if((bitmask & 1) == 1)
     System.out.print(array[pos]+",");
    bitmask >>= 1;
    pos--;
   }
   System.out.print("}");
 }
}
*/

/*   no of DIVISORSSSSSS
 public ArrayList<Integer> get(int x){
            ArrayList<Integer> divisors = new ArrayList<>();
            for(int i = 1; i * i <= x; i++){
                if(x % i == 0){
                    divisors.add(i);
                    if(i * i != x){
                        divisors.add( x / i);
                    }
                }
            }

*/
/*  //// find sum of multiple of a value below limit// ----> (l*(n+1))/2
  public static long getSequenceSum(long value, long limit) {
long q = (limit - 1) / value;
long ans = ((value*q)*(1+q) )/ 2;
return ans;
}
*/
/*// largest prime factor of a no
 public static long largestPrimeFactor(long n) {

        // largest composite factor must be smaller than sqrt
        long sqrt = (long)Math.ceil(Math.sqrt((double)n));

        long largest = -1;

        for(long i = 2; i <= sqrt; i++) {
            if(n % i == 0) {
                long test = largestPrimeFactor(n/i);
                if(test > largest) {
                    largest = test;
                }
            }
        }

        if(largest != -1) {
            return largest;
        }

        // number is prime
        return n;
    }
*/
/*    // prime no using sieve of erostheneses
  public static void prime()
{
  boolean[] isPrime = new boolean[100000000+ 1];
         Arrays.fill(isPrime, true);

        // mark non-primes <= N using Sieve of Eratosthenes
        for (int i = 2; i*i <= 100000000; i++)
        {

             if (isPrime[i])
             {
                for (int j = i; i*j <= 100000000; j++) {
                    isPrime[i*j] = false;
                }
            }
        }
}

*/
/*//// largest common sequences
 public String lcs(String str1, String str2)
    {
        int l1 = str1.length();
        int l2 = str2.length();

        int[][] arr = new int[l1 + 1][l2 + 1];

        for (int i = l1 - 1; i >= 0; i--)
        {
            for (int j = l2 - 1; j >= 0; j--)
            {
                if (str1.charAt(i) == str2.charAt(j))
                    arr[i][j] = arr[i + 1][j + 1] + 1;
                else
                    arr[i][j] = Math.max(arr[i + 1][j], arr[i][j + 1]);
            }
        }

        int i = 0, j = 0;
        StringBuffer sb = new StringBuffer();
        while (i < l1 && j < l2)

 {
            if (str1.charAt(i) == str2.charAt(j))
            {
                sb.append(str1.charAt(i));
                i++;
                j++;
            }
            else if (arr[i + 1][j] >= arr[i][j + 1])
                i++;
            else
                j++;
        }
        return sb.toString();
    }

*/


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class sand_and_island
{

    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;

        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }

        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }

      public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }

        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }

        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }

        }
        public String readLine() throws IOException{
            return s.readLine();
        }

        public void close() throws IOException{
            s.close();
        }

    }
     private static FastScanner s = new FastScanner();
     private static PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));

      static int count=0;
     public static void main(String[] args) throws IOException
     {
        int n=s.nextInt();int size=n;
        int k=s.nextInt();
        int temp=(n%2==0)?(n*n)/2:((n*n)/2)+1;
        if(k>temp)
             System.out.println("NO");
        else
        {
            System.out.println("YES");
            String[] my = new String[n];boolean arc=false;
            char[] ch = new char[n];
            String fill = new String(ch).replace('\0','S').toString();
           // System.out.println("fill  "+fill);
            for(int i=0;i<n;i++)
            {
                my[i]=fill;
            }
            for(int i=0;i<n;i++)
            {

                if(i%2==0)
                {
                    StringBuffer sb = new StringBuffer(my[i]);
                    for(int j=0;j<n;j=j+2)
                    {
                        sb.setCharAt(j, 'L');k--;  if(k==0)     {arc=true;break;}
                    }
                    my[i]=sb.toString();
                }
                else
                {
                     StringBuffer sb = new StringBuffer(my[i]);
                    for(int j=1;j<n;j=j+2)
                    {
                        sb.setCharAt(j, 'L');k--; if(k==0){arc=true;break;}
                    }
                    my[i]=sb.toString();

                }
                if(arc)break;
            }
            for(int j=0;j<n;j++)
            {
                System.out.println(""+my[j]);
            }

        }

         s.close();
         ww.close();
     }
     public static int gcd(int a, int b){
        return b == 0 ? a : gcd(b,a%b);
    }

}
/*zabardast swappimng of sorting
/*
    Arrays.sort(m, new Comparator<int[]>() {
                        @Override
                        public int compare(int[] int1, int[] int2)
                        {
                            Integer number1 = int1[1];
                            Integer number2 = int2[1];
                            return number1.compareTo(number2);
                        }
                         });
*/
/*
static final Point getMinMax(int[] array) {
        int min = array[0];
        int max = array[0];

        for (int index = 0, size = array.length; index < size; ++index, ++index) {
            int value = array[index];

            if (index == size - 1) {
                min = min(min, value);
                max = max(max, value);
            } else {
                int otherValue = array[index + 1];

                if (value <= otherValue) {
                    min = min(min, value);
                    max = max(max, otherValue);
                } else {
                    min = min(min, otherValue);
                    max = max(max, value);
                }
            }
        }

        return new Point(min, max);
    }

*/
/*

/// Demonstrate several Is... methods.
class IsDemo {
public static void main(String args[]) {
char a[] = {'a', 'b', '5', '?', 'A', ' '};
for(int i=0; i<a.length; i++) {
if(Character.isDigit(a[i]))                                   ///check if digit is present in string
System.out.println(a[i] + " is a digit.");
if(Character.isLetter(a[i]))
    System.out.println(num + " in binary: " +
Integer.toBinaryString(num));
System.out.println(num + " in octal: " +
Integer.toOctalString(num));
System.out.println(num + " in hexadecimal: " +
Integer.toHexString(num));
}
}
*/
/*
private static void findSubsets(int array[])
{
  int numOfSubsets = 1 << array.length;

  for(int i = 0; i < numOfSubsets; i++)
 {
    int pos = array.length - 1;                                /////bitmask to find all sub sets
   int bitmask = i;

   System.out.print("{");
   while(bitmask > 0)
   {
    if((bitmask & 1) == 1)
     System.out.print(array[pos]+",");
    bitmask >>= 1;
    pos--;
   }
   System.out.print("}");
 }
}
*/

/*   no of DIVISORSSSSSS
 public ArrayList<Integer> get(int x){
            ArrayList<Integer> divisors = new ArrayList<>();
            for(int i = 1; i * i <= x; i++){
                if(x % i == 0){
                    divisors.add(i);
                    if(i * i != x){
                        divisors.add( x / i);
                    }
                }
            }

*/
/*  //// find sum of multiple of a value below limit// ----> (l*(n+1))/2
  public static long getSequenceSum(long value, long limit) {
long q = (limit - 1) / value;
long ans = ((value*q)*(1+q) )/ 2;
return ans;
}
*/
/*// largest prime factor of a no
 public static long largestPrimeFactor(long n) {

        // largest composite factor must be smaller than sqrt
        long sqrt = (long)Math.ceil(Math.sqrt((double)n));

        long largest = -1;

        for(long i = 2; i <= sqrt; i++) {
            if(n % i == 0) {
                long test = largestPrimeFactor(n/i);
                if(test > largest) {
                    largest = test;
                }
            }
        }

        if(largest != -1) {
            return largest;
        }

        // number is prime
        return n;
    }
*/
/*    // prime no using sieve of erostheneses
  public static void prime()
{
  boolean[] isPrime = new boolean[100000000+ 1];
         Arrays.fill(isPrime, true);

        // mark non-primes <= N using Sieve of Eratosthenes
        for (int i = 2; i*i <= 100000000; i++)
        {

             if (isPrime[i])
             {
                for (int j = i; i*j <= 100000000; j++) {
                    isPrime[i*j] = false;
                }
            }
        }
}

*/
/*//// largest common sequences
 public String lcs(String str1, String str2)
    {
        int l1 = str1.length();
        int l2 = str2.length();

        int[][] arr = new int[l1 + 1][l2 + 1];

        for (int i = l1 - 1; i >= 0; i--)
        {
            for (int j = l2 - 1; j >= 0; j--)
            {
                if (str1.charAt(i) == str2.charAt(j))
                    arr[i][j] = arr[i + 1][j + 1] + 1;
                else
                    arr[i][j] = Math.max(arr[i + 1][j], arr[i][j + 1]);
            }
        }

        int i = 0, j = 0;
        StringBuffer sb = new StringBuffer();
        while (i < l1 && j < l2)

 {
            if (str1.charAt(i) == str2.charAt(j))
            {
                sb.append(str1.charAt(i));
                i++;
                j++;
            }
            else if (arr[i + 1][j] >= arr[i][j + 1])
                i++;
            else
                j++;
        }
        return sb.toString();
    }

*/


import java.util.Scanner;

public class GermanFarmer {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		boolean[][] isLand = new boolean[n][n];
		if (k>((n*n)/2)+n%2)System.out.println("NO");
		else{
			System.out.println("YES");
			if (k!=0){
			outerloop:
			for (int i = 0; i < isLand.length; i++) {
				for (int j = i%2; j < isLand.length; j+=2) {
					isLand[i][j]=true;
					k--;
					if (k==0) break outerloop;
				}
			}
			}

			for (int i = 0; i < isLand.length; i++) {
				for (int j = 0; j < isLand.length; j++) {
					if (isLand[i][j]) {
						System.out.print("L");
					}
					else System.out.print("S");
				}
				System.out.println();
			}
		}
	}
}


import java.util.Scanner;

public class GermanFarmer {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		boolean[][] isLand = new boolean[n][n];
		if (k>((n*n)/2)+n%2)System.out.println("NO");
		else{
			System.out.println("YES");
			outerloop:
			for (int i = 0; i < isLand.length; i++) {
				for (int j = i%2; j < isLand.length; j+=2) {
					isLand[i][j]=true;
					k--;
					if (k==0) break outerloop;
				}
			}

			for (int i = 0; i < isLand.length; i++) {
				for (int j = 0; j < isLand.length; j++) {
					if (isLand[i][j]) {
						System.out.print("L");
					}
					else System.out.print("S");
				}
				System.out.println();
			}
		}
	}
}


import java.util.Scanner;

public class GermanFarmer {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		boolean[][] isLand = new boolean[n][n];
		if (k>((n*n)/2)+n%2)System.out.println("NO");
		else{
			System.out.println("YES");
			outerloop:
			for (int i = 0; i < isLand.length; i++) {
				for (int j = i%2; j < isLand.length; j+=2) {
					isLand[i][j]=true;
					k--;
					if (k==0) break outerloop;
				}
			}

			for (int i = 0; i < isLand.length; i++) {
				for (int j = 0; j < isLand.length; j++) {
					if (isLand[i][j]) {
						System.out.print("S");
					}
					else System.out.print("L");
				}
				System.out.println();
			}
		}
	}
}


import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;
/*
	  br = new BufferedReader(new FileReader("input.txt"));
	  pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
	  br = new BufferedReader(new InputStreamReader(System.in));
	  pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
 */

public class Main {
	private static BufferedReader br;
	private static StringTokenizer st;
	private static PrintWriter pw;

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		//int qq = 1;
		int qq = Integer.MAX_VALUE;
		//int qq = readInt();
		for(int casenum = 1; casenum <= qq; casenum++) {
			int n = readInt();
			int k = readInt();
			char[][] grid = new char[n][n];
			for(int i = 0; i < n; i++) {
				Arrays.fill(grid[i], 'S');
			}
			for(int i = 0; i < n; i++) {
				for(int j = 0; j < n; j++) {
					if(k == 0) continue;
					if(i%2 != j%2) continue;
					k--;
					grid[i][j] = 'L';
				}
			}
			if(k != 0) {
				pw.println("NO");
				continue;
			}
			else {
				pw.println("YES");
				for(char[] out: grid) {
					pw.println(new String(out));
				}
			}
		}
		exitImmediately();
	}

	private static void exitImmediately() {
		pw.close();
		System.exit(0);
	}

	private static long readLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private static double readDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	private static int readInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	private static String nextLine() throws IOException  {
		if(!br.ready()) {
			exitImmediately();
		}
		st = null;
		return br.readLine();
	}

	private static String nextToken() throws IOException  {
		while(st == null || !st.hasMoreTokens())  {
			if(!br.ready()) {
				exitImmediately();
			}
			st = new StringTokenizer(br.readLine().trim());
		}
		return st.nextToken();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Ivan
 */
public class secondProblem {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        FastReader sc=new FastReader(System.in);
        int dimension=sc.nextInt();
        int islands=sc.nextInt();
        char[][] map=new char[dimension][dimension];
        int islandNb=0;
        for(int i=0;i<dimension;i++)
            for(int j=0;j<dimension;j++){
                if(i%2==j%2&&islandNb!=islands){
                    map[i][j]='L';
                    islandNb++;
                }
                else
                    map[i][j]='S';
            }
        if(islandNb!=islands)
            System.out.println("NO");
        else{
            System.out.println("YES");
            for(int i=0;i<dimension;i++){
                System.out.println();
                for(int j=0;j<dimension;j++)
                    System.out.print(map[i][j]);
        }
    }

}
}

class FastReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() throws IOException{
            return Integer.parseInt(next());
        }
         public long nextL() throws IOException{
            return Long.parseLong(next());
        }
    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Ivan
 */
public class secondProblem {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        FastReader sc=new FastReader(System.in);
        int dimension=sc.nextInt();
        int islands=sc.nextInt();
        char[][] map=new char[dimension][dimension];
        int islandNb=0;
        for(int i=0;i<dimension;i++)
            for(int j=0;j<dimension;j++){
                if(i%2==j%2&&islandNb!=islands){
                    map[i][j]='S';
                    islandNb++;
                }
                else
                    map[i][j]='L';
            }
        if(islandNb!=islands)
            System.out.println("NO");
        else{
            System.out.println("YES");
            for(int i=0;i<dimension;i++){
                System.out.println();
                for(int j=0;j<dimension;j++)
                    System.out.print(map[i][j]);
        }
    }

}
}

class FastReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() throws IOException{
            return Integer.parseInt(next());
        }
         public long nextL() throws IOException{
            return Long.parseLong(next());
        }
    }


import java.io.*;
import java.util.*;

public class test
{
    public static void main(String args[]) throws IOException
    {
        InputStreamReader inp = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(inp);

        String s[] = br.readLine().split(" ");
        double n = Double.parseDouble(s[0]);
        double k = Double.parseDouble(s[1]);

        if(n%2==0)
        {
            double d = n*(n/2);
            if(k>d)
            {
                System.out.println("NO");
                return;
            }
        }
        else
        {
            double aa = Math.ceil(n/2);
            double bb = Math.floor(n/2);

            double e = (aa*aa)+(bb*bb);

            if(k>e)
            {
                System.out.println("NO");
                return;
            }
        }

        int count=0;
        int flag=0;
        int g = (int)n;

        char map[][] = new char[g][g];
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                map[i][j] = 'S';
            }
        }
        qq:
        for(int i=0;i<g;i++)
        {
            if(flag==0){
            for(int j=0;j<g;j=j+2)
            {

                map[i][j] = 'L';
                count++;

                if(count==k)
                {
                    break qq;
                }
            }
                flag=1;

            }
            else
            {
                for(int j=1;j<g;j=j+2)
                {

                        map[i][j] = 'L';
                        count++;

                    if(count==k)
                    {
                        break qq;
                    }
                }
                flag=0;

            }
        }

        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }

    }
}


import java.io.*;
import java.util.*;

public class test
{
    public static void main(String args[]) throws IOException
    {
        InputStreamReader inp = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(inp);

        String s[] = br.readLine().split(" ");
        double n = Double.parseDouble(s[0]);
        double k = Double.parseDouble(s[1]);

        if(n%2==0)
        {
            double d = n*(n/2);
            if(k>d)
            {
                System.out.println("NO");
                return;
            }
        }
        else
        {
            double aa = Math.ceil(n/2);
            double bb = Math.floor(n/2);

            double e = (aa*aa)+(bb*bb);

            if(k>e)
            {
                System.out.println("NO");
                return;
            }
        }

        int count=0;
        int flag=0;
        int g = (int)n;

        char map[][] = new char[g][g];
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                map[i][j] = 'S';
            }
        }
        qq:
        for(int i=0;i<g;i++)
        {
            if(flag==0){
            for(int j=0;j<g;j=j+2)
            {

                    map[i][j] = 'L';
                    count++;

                if(count==k)
                {
                    break qq;
                }
            }
                flag=1;

            }
            else
            {
                for(int j=1;j<g;j=j+2)
                {

                        System.out.print("L");
                        count++;

                    if(count==k)
                    {
                        break qq;
                    }
                }
                flag=0;

            }
        }

        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }

    }
}


import java.io.*;
import java.util.*;

public class test
{
    public static void main(String args[]) throws IOException
    {
        InputStreamReader inp = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(inp);

        String s[] = br.readLine().split(" ");
        double n = Double.parseDouble(s[0]);
        double k = Double.parseDouble(s[1]);

        if(n%2==0)
        {
            double d = n*(n/2);
            if(k>d)
            {
                System.out.println("NO");
                return;
            }
        }
        else
        {
            double aa = Math.ceil(n/2);
            double bb = Math.floor(n/2);

            double e = (aa*aa)+(bb*bb);

            if(k>e)
            {
                System.out.println("NO");
                return;
            }
        }

        int count=0;
        int flag=0;
        int g = (int)n;

        char map[][] = new char[g][g];
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                map[i][j] = 'S';
            }
        }
        qq:
        for(int i=0;i<g;i++)
        {
            if(flag==0){
            for(int j=0;j<g;j=j+2)
            {

                map[i][j] = 'L';
                count++;

                if(count==k)
                {
                    break qq;
                }
            }
                flag=1;

            }
            else
            {
                for(int j=1;j<g;j=j+2)
                {

                        map[i][j] = 'L';
                        count++;

                    if(count==k)
                    {
                        break qq;
                    }
                }
                flag=0;

            }
        }

        System.out.println("YES");
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }

    }
}


import java.io.*;
import java.util.*;

public class test
{
    public static void main(String args[]) throws IOException
    {
        InputStreamReader inp = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(inp);

        String s[] = br.readLine().split(" ");
        double n = Double.parseDouble(s[0]);
        double k = Double.parseDouble(s[1]);

        if(n%2==0)
        {
            double d = n*(n/2);
            if(k>d)
            {
                System.out.println("NO");
                return;
            }
        }
        else
        {
            double aa = Math.ceil(n/2);
            double bb = Math.floor(n/2);

            double e = (aa*aa)+(bb*bb);

            if(k>e)
            {
                System.out.println("NO");
                return;
            }
        }

        int count=0;
        int flag=0;
        int g = (int)n;

        char map[][] = new char[g][g];
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                map[i][j] = 'S';
            }
        }

        if(k==0)
        {
            System.out.println("YES");
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }
        return;
        }
        qq:
        for(int i=0;i<g;i++)
        {
            if(flag==0){
            for(int j=0;j<g;j=j+2)
            {

                map[i][j] = 'L';
                count++;

                if(count==k)
                {
                    break qq;
                }
            }
                flag=1;

            }
            else
            {
                for(int j=1;j<g;j=j+2)
                {

                        map[i][j] = 'L';
                        count++;

                    if(count==k)
                    {
                        break qq;
                    }
                }
                flag=0;

            }
        }

        System.out.println("YES");
        for(int i=0;i<g;i++)
        {
            for(int j=0;j<g;j++)
            {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }

    }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n=in.nextInt(),k=in.nextInt();
        char ar[][]=new char[n][n];
        for(int i=0;i<n;i++) {
            Arrays.fill(ar[i], 'S');
        }
        for(int i=0;i<n;i++){
            if(k==0)
                break;
            if(i%2==0){
                for(int j=0;j<n;j+=2){
                    ar[i][j]='L';
                    k--;
                    if(k==0)
                        break;
                }
            }
            else {
                for(int j=1;j<n;j+=2){
                    ar[i][j]='L';
                    k--;
                    if(k==0)
                        break;
                }
            }
        }
        if(k==0){
            out.printLine("YES");
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    out.print(ar[i][j]);
                }
                out.printLine();
            }
        }
        else {
            out.printLine("NO");
        }

    }
}

class InputReader {
    BufferedReader in;
    StringTokenizer tokenizer=null;

    public InputReader(InputStream inputStream)
    {
        in=new BufferedReader(new InputStreamReader(inputStream));
    }
    public String next()
    {
        try{
            while (tokenizer==null||!tokenizer.hasMoreTokens())
            {
                tokenizer=new StringTokenizer(in.readLine());
            }
            return tokenizer.nextToken();
        }
        catch (IOException e)
        {
            return null;
        }
    }
    public int nextInt()
    {
        return Integer.parseInt(next());
    }
}

class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

    public void print(Object...objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object...objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n=in.nextInt(),k=in.nextInt();
        char ar[][]=new char[n][n];
        for(int i=0;i<n;i++) {
            Arrays.fill(ar[i], 'S');
        }
        for(int i=0;i<n;i++){
            Arrays.fill(ar[i],'S');
            if(i%2==0){
                for(int j=0;j<n;j+=2){
                    ar[i][j]='L';
                    k--;
                    if(k==0)
                        break;
                }
            }
            else {
                for(int j=1;j<n;j+=2){
                    ar[i][j]='L';
                    k--;
                    if(k==0)
                        break;
                }
            }
            if(k==0)
                break;
        }
        if(k==0){
            out.printLine("YES");
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    out.print(ar[i][j]);
                }
                out.printLine();
            }
        }
        else {
            out.printLine("NO");
        }

    }
}

class InputReader {
    BufferedReader in;
    StringTokenizer tokenizer=null;

    public InputReader(InputStream inputStream)
    {
        in=new BufferedReader(new InputStreamReader(inputStream));
    }
    public String next()
    {
        try{
            while (tokenizer==null||!tokenizer.hasMoreTokens())
            {
                tokenizer=new StringTokenizer(in.readLine());
            }
            return tokenizer.nextToken();
        }
        catch (IOException e)
        {
            return null;
        }
    }
    public int nextInt()
    {
        return Integer.parseInt(next());
    }
}

class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

    public void print(Object...objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object...objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }
}


import java.util.Arrays;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int k = in.nextInt();
        char[][] a = new char[n][n];
        int count = 0;
        for (int i = 0; i < n; i++) {
            Arrays.fill(a[i], 'S');
            for (int j = i % 2; j < n; j += 2) {
                if (count < k) {
                    a[i][j] = 'L';
                    ++count;
                }
            }
        }
        if (count < k) {
            out.println("NO");
        } else {
            out.println("YES");
            for (int i = 0; i < n; i++) {
                out.println(new String(a[i]));
            }
        }
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
            try (PrintWriter out = new PrintWriter(outputStream)) {
                TaskB solver = new TaskB();
                solver.solve(1, in, out);
            }
	}
}
class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
       int n = in.nextInt();
       int k = in.nextInt();
       if(k > (n/2)*(n/2) + (n - n/2)*(n - n/2)){
           out.println("NO");
           return;
       }
       out.println("YES");
           for(int i = 0; i < n; ++i){
               for(int j = 0; j < n; ++j){
                   if(k == 0 || (i + j)%2 == 1){
                       out.print('S');
                   }else{
                       out.print('L');
                       k--;
                   }
               }
               out.println();
           }

    }
 }
class InputReader {
    private final BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
            try (PrintWriter out = new PrintWriter(outputStream)) {
                TaskB solver = new TaskB();
                solver.solve(1, in, out);
            }
	}
}
class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
       int n = in.nextInt();
       int k = in.nextInt();
       if(2*k > n*n){
           out.println("NO");
           return;
       }
       out.println("YES");
           for(int i = 0; i < n; ++i){
               for(int j = 0; j < n; ++j){
                   if(k == 0 || (i + j)%2 == 1){
                       out.print('S');
                   }else{
                       out.print('L');
                       k--;
                   }
               }
               out.println();
           }

    }
 }
class InputReader {
    private final BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Sealand {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String inp[] = new String[2];
		inp = br.readLine().split(" ");
		int n= Integer.parseInt(inp[0]);
		int k= Integer.parseInt(inp[1]);
		if(n%2==0 && k>n*n/2){
			System.out.println("NO");
		}
		else if(n%2==1 && k>(n*n+1)/2){
			System.out.println("NO");
		}
		else{
			System.out.println("YES");
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if((i+j)%2==0 && k>0){
						System.out.print("L");
						k--;
					}
					else{
						System.out.print("S");
					}
				}
				System.out.println();
			}
		}
	}

}


import java.util.Scanner;
public class Islands {

		public static void main(String args[])
		{
			Scanner sc = new Scanner (System.in);

			int n = sc.nextInt();
			int k = sc.nextInt();
			sc.nextLine();

			int temp = n/2 + 1;
			int max_islands = temp*temp;

			if(k>max_islands)
			{
				System.out.println("NO");
				return;
			}

			System.out.println("YES");
			int i=1,j=1,island_count=0;
			while(i<=n)
			{
				j=1;
				if(i%2!=0)
				{
					while(j<=n)
					{
						if(island_count<k)
						{
							if(j%2!=0)
							{
								System.out.print("L");
								island_count++;
								j++;
								continue;
							}
						}
								System.out.print("S");

							j++;
					}
				}
				else
				{
					while(j<=n)
					{
						System.out.print("S");
						j++;
					}
				}
				System.out.println();
				i++;
			}

		}
}


import java.util.Scanner;
public class Islands {

		public static void main(String args[])
		{
			Scanner sc = new Scanner (System.in);

			int n = sc.nextInt();
			int k = sc.nextInt();
			sc.nextLine();
			int temp;
			if(n%2==0)
				temp = n/2;
			else
				temp =n/2 +1;
			int max_islands = temp*temp;

			if(k>max_islands)
			{
				System.out.println("NO");
				return;
			}

			System.out.println("YES");
			int i=1,j=1,island_count=0;
			while(i<=n)
			{
				j=1;
				if(i%2!=0)
				{
					while(j<=n)
					{
						if(island_count<k)
						{
							if(j%2!=0)
							{
								System.out.print("L");
								island_count++;
								j++;
								continue;
							}
						}
								System.out.print("S");

							j++;
					}
				}
				else
				{
					while(j<=n)
					{
						System.out.print("S");
						j++;
					}
				}
				System.out.println();
				i++;
			}

		}
}


import java.util.Scanner;
public class Islands {

		public static void main(String args[])
		{
			Scanner sc = new Scanner (System.in);

			int n = sc.nextInt();
			int k = sc.nextInt();
			sc.nextLine();
			int max_islands;
			if(n%2==0)
				max_islands = (n/2)*n;
			else
				max_islands = (n/2+1)*(n/2+1) + (n/2)*(n/2);
			if(max_islands<k)
			{
				System.out.println("NO");
				return;
			}
			System.out.println("YES");
			int island_count=0;
			int i=1,j=1,flag=0;
			while(i<=n)
			{
				j=1;
				while(j<=n)
				{
					if(island_count<k)
					{
						if(i%2==0)
						{
							if(j%2==0)
							{
								System.out.print("L");
								island_count++;

							}
							else
							{
								System.out.print("S");
							}

						}
						else
						{
							if(j%2==0)
								System.out.print("S");
							else
							{
								System.out.print("L");
								island_count++;
							}
						}
					j++;
					}
					else
					{
						flag =1;
						break;
					}
				}
				if(flag==1)
				{//System.out.println("\nYO IN " + i);
					while(i<=n)
					{

						while(j<=n)
						{
							System.out.print("S");
							j++;
						}
						j=1;
						System.out.println();
						i++;
					}
					//System.out.println(i);
					break;
				}
				System.out.println();
				i++;
			}

		}
}


import java.util.Scanner;
public class Islands {

		public static void main(String args[])
		{
			Scanner sc = new Scanner (System.in);

			int n = sc.nextInt();
			int k = sc.nextInt();
			sc.nextLine();
			int max_islands;
			if(n%2==0)
				max_islands = (n/2)*n;
			else
				max_islands = (n/2+1)*(n/2+1) + (n/2)*(n/2);
			if(max_islands<k)
			{
				System.out.println("NO");
				return;
			}
			int island_count=0;
			int i=1,j=1,flag=0;
			while(i<=n)
			{
				j=1;
				while(j<=n)
				{
					if(island_count<k)
					{
						if(i%2==0)
						{
							if(j%2==0)
							{
								System.out.print("L");
								island_count++;

							}
							else
							{
								System.out.print("S");
							}

						}
						else
						{
							if(j%2==0)
								System.out.print("S");
							else
							{
								System.out.print("L");
								island_count++;
							}
						}
					j++;
					}
					else
					{
						flag =1;
						break;
					}
				}
				if(flag==1)
				{//System.out.println("\nYO IN " + i);
					while(i<=n)
					{

						while(j<=n)
						{
							System.out.print("S");
							j++;
						}
						j=1;
						System.out.println();
						i++;
					}
					//System.out.println(i);
					break;
				}
				System.out.println();
				i++;
			}

		}
}


import java.util.Scanner;
public class Islands {

		public static void main(String args[])
		{
			Scanner sc = new Scanner (System.in);

			int n = sc.nextInt();
			int k = sc.nextInt();
			sc.nextLine();

			if(n%2==0)
				temp = n/2;
			else
				temp =n/2 +1;
			int max_islands = temp*temp;

			if(k>max_islands)
			{
				System.out.println("NO");
				return;
			}

			System.out.println("YES");
			int i=1,j=1,island_count=0;
			while(i<=n)
			{
				j=1;
				if(i%2!=0)
				{
					while(j<=n)
					{
						if(island_count<k)
						{
							if(j%2!=0)
							{
								System.out.print("L");
								island_count++;
								j++;
								continue;
							}
						}
								System.out.print("S");

							j++;
					}
				}
				else
				{
					while(j<=n)
					{
						System.out.print("S");
						j++;
					}
				}
				System.out.println();
				i++;
			}

		}
}


import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Al_Deeb
 */
public class sd {

     public static void main (String []args)
    {

	 Scanner sc=new Scanner(System.in);

       int n=sc.nextInt();
       int k=sc.nextInt();
      int ii=0;
      boolean ff=false;
      char[][] map=new char[n][n];
      if(k==0)ff=true;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {

                if(!ff)
                {
               if(i%2==0)
               {
                   if(j%2==0)
                   {map[i][j]='L';
                   k--;
                   }
                   else
                   map[i][j]='S';

               }
               else
               {
                    if(j%2==0)
                   map[i][j]='S';
                   else
                    {map[i][j]='L';
                    k--;
                    }

               }
               if(k==0)ff=true;
                }
                else
                {

                     map[i][j]='S';
                }

            }

        }

        if(k==0)
        {System.out.println("YES");

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }
        }
        else
              System.out.println("NO");
    }

}


import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Al_Deeb
 */
public class sd {

     public static void main (String []args)
    {

	 Scanner sc=new Scanner(System.in);

       int n=sc.nextInt();
       int k=sc.nextInt();
      int ii=0;
      boolean ff=false;
      char[][] map=new char[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {

                if(!ff)
                {
               if(i%2==0)
               {
                   if(j%2==0)
                   {map[i][j]='L';
                   k--;
                   }
                   else
                   map[i][j]='S';

               }
               else
               {
                    if(j%2==0)
                   map[i][j]='S';
                   else
                    {map[i][j]='L';
                    k--;
                    }

               }
               if(k==0)ff=true;
                }
                else
                {

                     map[i][j]='S';
                }

            }

        }

        if(k==0)
        {System.out.println("YES");

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }
        }
        else
              System.out.println("NO");
    }

}


import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Al_Deeb
 */
public class sd {

     public static void main (String []args)
    {

	 Scanner sc=new Scanner(System.in);

       int n=sc.nextInt();
       int k=sc.nextInt();
      int ii=0;
      boolean ff=false;
      char[][] map=new char[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {

                if(!ff)
                {
               if(i%2==0)
               {
                   if(j%2==0)
                   {map[i][j]='L';
                   k--;
                   }
                   else
                   map[i][j]='S';

               }
               else
               {
                    if(j%2==0)
                   map[i][j]='S';
                   else
                    {map[i][j]='L';
                    k--;
                    }

               }
               if(k==0)ff=true;
                }
                else
                {

                     map[i][j]='S';
                }

            }

        }

        if(k==0)System.out.println("YES");
        else System.out.println("NO");
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(map[i][j]);
            }
            System.out.println();
        }

    }

}


import java.util.*;
public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();

        int can = n%2 == 0 ? n/2 : n/2 + 1;
        if (k > can)
            System.out.println("NO");
        else {
            System.out.println("YES");
            boolean land = false;
            int i = 0;
            for (int isles = 0; isles < k;) {
                if (land)
                    land = false;
                else {
                    land = true;
                    isles++;
                }
                for (int j = 0; j < n; j++) {
                    if (land) {
                        System.out.print("L");

                    }
                    else
                        System.out.print("S");
                }
                System.out.println();
                i++;
            }

            for (; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    System.out.print("S");
                }
                System.out.println();
            }
        }
    }
}


import java.util.*;
public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();

        int can = n%2 == 0 ? n/2 * n : n/2 * n + n/2 + 1;
        if (k > can)
            System.out.println("NO");
        else {
            System.out.println("YES");
            boolean land = false;
            int i = 0;
            for (int isles = 0; (isles < k) && (i < n);) {
                int j = 0;
                for (; (isles < k) && (j < n); j++) {
                    if (land)
                        land = false;
                    else {
                        land = true;
                        isles++;
                    }
                    if (land) {
                        System.out.print("L");

                    }
                    else
                        System.out.print("S");
                }
                if (j != n) {
                    for (int m = j; m < n; m++) {
                        System.out.print("S");
                    }
                }
                if (n%2 == 0) {
                    if (land)
                        land = false;
                    else {
                        land = true;
                    }
                }
                System.out.println();
                i++;
            }

            for (; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    System.out.print("S");
                }
                System.out.println();
            }
        }
    }
}


import java.util.*;
public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();

        int can = n%2 == 0 ? n/2 * n : n/2 * n + n/2 + 1;
        if (k > can)
            System.out.println("NO");
        else {
            System.out.println("YES");
            boolean land = false;
            int i = 0;
            for (int isles = 0; (isles < k) && (i < n);) {
                int j = 0;
                for (; (isles < k) && (j < n); j++) {
                    if (land)
                        land = false;
                    else {
                        land = true;
                        isles++;
                    }
                    if (land) {
                        System.out.print("L");

                    }
                    else
                        System.out.print("S");
                }
                if (j != n) {
                    for (int m = j; m < n; m++) {
                        System.out.print("S");
                    }
                }
                System.out.println();
                i++;
            }

            for (; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    System.out.print("S");
                }
                System.out.println();
            }
        }
    }
}


import java.lang.*;
import java.io.*;
import java.util.*;

public class Islands {

	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {

	public void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		int m = n;
		int h = (n+1)/2, h_ = n/2;
		int mx = h*h + h_*h_;
		String[] ans = new String[n];
		String sh = "", sh_ = "";

		if (k > mx) {
			out.println("NO");
			return ;
		}

		out.println("YES");

		StringBuilder sb;
		int i = 0, j;

		for (j=0; j<m; ++j) {
			if ((j & 1) > 0) {
				sh = sh + "S";
				sh_ = sh_ + "L";
			} else {
				sh = sh + "L";
				sh_ = sh_ + "S";
			}
		}

		while (k > 0) {
			if (k > h) {
				ans[i] = sh;
				k -= h;
				++i;
			} else {
				sb = new StringBuilder();
				j = 0;
				while (k > 0) {
					sb.append('L');
					--k;
					if (++j >= m)
						break;
					sb.append('S');
					if (++j >= m)
						break;
				}
				while (j++ < m)
					sb.append('S');
				ans[i] = sb.toString();
				++i;
				break;
			}

			sb = new StringBuilder();
			if (k > h_) {
				ans[i] = sh_;
				k -= h_;
				++i;
			} else {
				sb = new StringBuilder();
				j = 0;
				while (k > 0) {
					sb.append('S');
					sb.append('L');
					--k;
					j += 2;
					if (j >= m)
						break;
				}
				while (j++ < m)
					sb.append('S');
				ans[i] = sb.toString();
				++i;
				break;
			}
		}

		sb = new StringBuilder();
		for (j=0; j<m; ++j)
			sb.append('S');
		while (i < n) {
			ans[i] = sb.toString();
			++i;
		}

		for (i=0; i<n; ++i)
			out.println(ans[i]);
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}

	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}
}


import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Tamil
 */
public class SeaAndIslands {

    static char arr[][];

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        arr = new char[n][n];
        int k = s.nextInt();
        for (int i = 0; i < n; i++) Arrays.fill(arr[i], 'S');
        int res = fill(k, 0, 0);

        if (res == k) {
            System.out.println("YES");
            for (char cc[] : arr) {
                for (char c : cc) System.out.print(c);
                System.out.println("");
            }
        }else System.out.println("NO");
        //System.out.println("res : "+res);
    }

    private static int fill(int k, int i, int j) {
        if (k == 0) return 0;
        arr[i][j] = 'L';
        if (j+2 < arr.length) return 1 + fill(k - 1, i, j + 2);
        else if (i+1 < arr.length ) return 1 + fill(k - 1, i + 1, j % 2 == 0 ? 1 : 0);
        else return 1;
    }
}


import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Tamil
 */
public class SeaAndIslands {

    static char arr[][];

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        arr = new char[n][n];
        int k = s.nextInt();
        for (int i = 0; i < n; i++) {
            Arrays.fill(arr[i], 'S');
        }
        int res = fill(k, 0, 0);
        if (res == k) {
            System.out.println("YES");
            for (char cc[] : arr) {
                for (char c : cc) {
                    System.out.print(c);
                }
                System.out.println("");
            }
        }else System.out.println("NO");

    }

    private static int fill(int k, int i, int j) {
        if (k == 0) {
            return 0;
        }
        arr[i][j] = 'L';
        if (j < arr.length - 2) {
            return 1 + fill(k - 1, i, j + 2);
        } else if (i < arr.length - 1) {
            return 1 + fill(k - 1, i + 1, j % 2 == 0 ? 1 : 0);
        } else {
            return 0;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main{
static int n;
static int T;
static int T1;
static char[][] grid;
	public static void main(String[]args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		T = Integer.parseInt(st.nextToken());
		grid = new char[n][n];
		T1 = T;
		if(T==1&&n==1){
			System.out.println("L");
			return;
		}
		if(T==0){
			printS();
			return;
		}
		if(T>=n) {
			System.out.println("NO");
			return;
		}

		fill2();

		if(T1==0){
			System.out.println("YES");
			print();
		}
		else {
			fill1();
			if(T==0){
				System.out.println("YES");
				print();
			}
			else{
				System.out.println("NO");
			}
		}
	}

	public static void print(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(grid[i][j]);
			}
			System.out.println("");
		}
	}

	public static void printS(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)System.out.print("S");
			System.out.println("");
		}
	}
	public static void printall(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)System.out.print("L");
			System.out.println("");
		}
	}

	public static void fill1(){
		boolean flag = true;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(flag) grid[i][j] ='L';
				else grid[i][j] = 'S';
			}
			if(flag&&T>0)T--;
			flag = !flag;
			if(T==0) flag = false;
		}
	}

	public static void fill2(){
		boolean flag = false;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(flag) grid[i][j] ='L';
				else grid[i][j] = 'S';
			}
			if(flag&&T1>0)T1--;
			flag = !flag;
			if(T1==0) flag = false;
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
static int n;
static int T;
static char[][] grid;
	public static void main(String[]args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		T = Integer.parseInt(st.nextToken());
		grid = new char[n][n];

		if(T==0){
			printS();
			return;
		}
		if(T>n) {
			System.out.println("NO");
			return;
		}
		if(T==n){
			printall();
			return;
		}
		if(n%T==0)fill1();
		else fill2();

		if(T==0){
			System.out.println("YES");
			print();
		}
		else System.out.println("NO");
	}

	public static void print(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(grid[i][j]);
			}
			if(i!=n-1)System.out.println("");
		}
	}

	public static void printS(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)System.out.print("S");
			if(i!=n-1)System.out.println("");
		}
	}
	public static void printall(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)System.out.print("L");
			if(i!=n-1)System.out.println("");
		}
	}

	public static void fill1(){
		boolean flag = true;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(flag) grid[i][j] ='L';
				else grid[i][j] = 'S';
			}
			if(flag&&T>0)T--;
			flag = !flag;
			if(T==0) flag = false;
		}
	}

	public static void fill2(){
		boolean flag = false;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(flag) grid[i][j] ='L';
				else grid[i][j] = 'S';
			}
			if(flag&&T>0)T--;
			flag = !flag;
			if(T==0) flag = false;
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
static int n;
static int T;
static int T1;
static char[][] grid;
	public static void main(String[]args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		T = Integer.parseInt(st.nextToken());
		grid = new char[n][n];

        paint();
        if(T>0) System.out.println("NO");
        else{
        	System.out.println("YES");
        	print();
        }
	}

	public static void print(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(grid[i][j]);
			}
			System.out.println("");
		}
	}

	static void paint(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(i%2==0){
					if(j%2==0&&T>0){
						grid[i][j]= 'L';
						T--;
					}
					else grid[i][j] ='S';
				}
				else{
					if(j%2==0||T==0)
						grid[i][j] = 'S';
					else {
						grid[i][j] = 'L';
						T--;
					}

				}
			}
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main{
static int n;
static int T;
static char[][] grid;
	public static void main(String[]args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		T = Integer.parseInt(st.nextToken());
		grid = new char[n][n];

		if(T==0){
			printS();
			return;
		}
		if(T>n) {
			System.out.println("NO");
			return;
		}
		if(T==n){
			printall();
			return;
		}
		if(n%T==0)fill1();
		else fill2();

		if(T==0)print();
		else System.out.println("NO");
	}

	public static void print(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(grid[i][j]);
			}
			System.out.println("");
		}
	}

	public static void printS(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)System.out.print("S");
			System.out.println("");
		}
	}
	public static void printall(){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)System.out.print("L");
			System.out.println("");
		}
	}

	public static void fill1(){
		boolean flag = true;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(flag) grid[i][j] ='L';
				else grid[i][j] = 'S';
			}
			if(flag&&T>0)T--;
			flag = !flag;
			if(T==0) flag = false;
		}
	}

	public static void fill2(){
		boolean flag = false;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(flag) grid[i][j] ='L';
				else grid[i][j] = 'S';
			}
			if(flag&&T>0)T--;
			flag = !flag;
			if(T==0) flag = false;
		}
	}
}