Can the distance sensor identify object size for mobile goals and rings?

So our school have a low budget and we can only purchase one sensor, so we are deciding to purchase either distance sensor or optical sensor, and I found out that the distance sensor can actually identify object size as small large and median, and I was wondering when it’s identifying the mobile goals and the rings will it be able to tell the difference? for example mobile goals is like
median and rings be small and the ladder be large? Thanks!