#!/usr/bin/env python3 import sys def main(): X, Y = map(int, input().split()) if X == Y: print(0) return if X == 0: print(2) return if Y == 0: print(1) return print(-1) return if __name__ == '__main__': main()