factorial(0,1).% initializing the value of X shoudn't be <=0 and the initial value of Y is
factorial(X,Y):-X1 is X-1,
                factorial(X1,N),
                 Y is X*N.