Yes, I think so. Because the eyesight the shark has is not so good, and then the fishes are swimming all together the shark sees it as a big big big fish, and then I guess it feels so weak, and swim away. But if one fish is swimming out from the other fishes the shark would probably eat it.
But if it met a whale it would be scared.