multiply([],_,[]).
multiply([1],Y,Y).
multiply([1,1|X],Y,Product) :- multiply([1|X], Y, Tmp), sum(Y,Tmp,Product).
