#include using namespace std; int main(){ int n,m; if(n<=m)printf("1"); else { if(n%2==0&&n>=n/2)printf("2"); else printf("-1"); } }