Used solve to find if x^n*y is present