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.
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.