CMIMC 2017 Combinatorics Problem 2

Let S be a subset of \{1,2, \ldots, 2017\} such that for any two distinct elements in S, both their sum and product are not divisible by seven. Compute the maximum number of elements that can be in S.