When the Children of Israel stood at the shore of the sea and saw the Egyptian armies closing in behind them, they split into four groups. One faction said, "Let us cast ourselves into the sea." A second faction said, "Let us return to Egypt." A third said, "Let us wage war against the Egyptians." A fourth said, "Let us cry out to G-d." But G-d rejected all four approaches and said to Moses, "Speak to the children of Israel, that they go forward."
Midrash Mechilta