Anyway, comparing floats for equality is a known problem, you should never do that. Instead, check if the 2 values are close enough or, in other words, if the distance between 2 floats is close enough to zero.
There are multiple approachs for this, in your case I’d do:
Vector3 aux = transform.position - player.transform.position - cameraPosition;
if( aux.sqrMagnitude < 0.01f) //set a proper value, 0.01f is just an example
print("yes");