jrMz has two types of angles, one type of angle is an interior angle of $n$-sided regular polygon, and the other type of angle is an interior angle of $m$-sided regular polygon. jrMz wants to use them to make up an angle of 360 degrees, which means, jrMz needs to choose some or none of the angles which belong to the first type and some or none of the angles which belong to the second type so that the sum value of the angles chosen equals 360 degrees. But jrMz doesn’t know whether it is possible, can you help him?