#include int main(){ int n, m;; scanf("%d %d", &n, &m); if(n <= m){ printf("1\n"); }else if(m >= n/2){ printf("2\n"); }else{ printf("-1\n"); } return 0; }