Let $S = 2^3 + 3^4 + 5^4 + 7^4 + \cdots + 17497^4$ be the sum of the fourth powers of the first $2014$ prime numbers. Find the remainder when $S$ is divided by $240$.

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