Let $n>0$ be an integer, and let $[n] = \{1,\ldots,n\}$. A function $f:[n]\to \mathbb{Z}$ is said to be in- and out-degree-realizable (or io-realizable for short) if there is a directed graph $G = ([n], E)$ where $E \subseteq [n]\times[n]$ such that for all $k\in[n]$ we have $$f(k) = \text{deg}_+(k) - \text{deg}_-{k}$$ where $\text{deg}_+(\cdot)$ denotes the in-degree of $k$, and $\text{deg}_-{k}$$\text{deg}_-{k}(\cdot)$ denotes the out-degree of $k$.
Of course, any io-realizable functions obeys the condition $\sum_{k\in[n]} f(k) = 0$.
If $f:[n]\to \mathbb{Z}$ obeys the condition above and $|f(k)| < n/2$ for all $k\in[n]$, is $f$ io-realizable?