n,m=map(int,input().split()) if n<=m or n%m==0: print(n//m) else: print(-1)