IMO, numbers are x=3 and y=4.
S is given value 7 (x + y) and P is given value 12 (xy).
For P, 12 can result into x=2, y=6 or x=3 and y=4. therefore, he/she can not figure of numbers x and y.
For S, 7 can result into x=2 and y=5 or x=3 and y=4.
The logic S applies is, if numbers were 2 and 5, their product (xy) will be 10 and if P has that value, he/she can figure out the numbers. If numbers were 3 and 4, their product (xy) will be 12 and if P has that value, he/she can not determine whether numbers are 2 and 6 or 3 and 4. As P says it can not figure out the numbers, it means the numbers are not 2 and 5. That leaves x=3 and y=4.