A generalization of Poincare's theorem for recurrence equations