# Counting surjective functions

Let $$I_7=\{1,2,3,4,5,6,7\}$$. Let $$N$$ be the number of surjective functions $$f:I_7\to I_7$$ such that $$f(f(a))\neq a$$ for all values of $$a$$. What are the last three digits of $$N$$?

Details and assumptions

A function $$f:A \to B$$ is surjective if for each $$b \in B$$, there exists $$a\in A$$ such that $$f(a)=b$$.

×