import java.util.*;  

public class Main {

    public static void main(String[] args) {
       Scaner sc=new Scanner(System.in);
      Long n=sc.nextLong();
      Long p=sc.nextLong();
      if (n==1)
        System.out.println(p);
      else
        System.out.println(1);
    }

}