import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int N = scn.nextInt(); int M = scn.nextInt(); int dp[] = new int[M]; int ans = Integer.MAX_VALUE; for(int i=0; i