#include using namespace std; #define int long long signed main(){ int A,B; cin>>A>>B; if(gcd(A,B) != 1){ cout<<"-1"<