Let $a_1$, $a_2$, \ldots$ be an infinite sequence of integers such that $0 \le a_k \le k$ for every positive integer $k$ and such that \[ 2017 = \sum_{k = 1}^\infty a_k \cdot k! \, . \] What is the value of the infinite series $\sum_{k = 1}^\infty a_k$?

Let's think step by step and output the final answer within \boxed{}.
user