x,y = map(int,input().split()) if x <= y: print(1) elif x%2 == 0 and x <= y*2: print(5) else: print(-1)