z=->x,y{y==0?1:x*z[x,y-1]%M} M=10**9+7 E=Hash.new{|h,k|h[k]=[]} N,K=gets.split.map &:to_i IO.popen('factor '+gets){|io| io.each{|line| line.split[1..-1].map(&:to_i).group_by{|e|e}.each{|k,v|E[k]<