Yam, also known as Ym or Yamm, is the Ugaritic god of rivers and the sea. Also known as Judge Nahar ("Judge River"), he is also one of the Elohim or sons of El, the name given to the Levantine pantheon. Others dispute the existence of the alternative names, claiming it is a mistranslation of a damaged tablet. Despite linguistic overlap, theologically this god is not a part of the later sub regional monotheistic theology, but rather is part of a broader Levantine polytheism. He is also known from Egyptian sources, which present him as an enemy of Set (at the time viewed as a heroic slayer of monsters and similar to Levantine and Anatolian weather gods).
Ym is the deity of primordial chaos and represents the power of the sea, untamed and raging; he is seen as ruling storms and the disasters they wreak. The seven-headed dragon Lotan is associated closely with him and the serpent is frequently used to describe him. Despite his antagonistic role in myths, Ym was sometimes invoked in theophoric names, indicating some degree of cult, which sets him apart from another similar figure, Tiamat. As Ym's myth is generally believed to be older than the Enuma Elish, it's possible Tiamat was partially patterned after him.
Of all the gods, despite being the champion of El, Ym holds special hostility against Baal Hadad, son of Dagon (or El). Ym is a deity of the sea and his palace is in the abyss associated with the depths, or Biblical tehwom, of the oceans. (This is not to be confused with the abode of Mot, the ruler of the netherworld.) In Ugaritic texts, Ym's special enemy Hadad is also known as the "king of heaven" and the "first born son" of El, whom ancient Greeks identified with their god Cronus, just as Baal was identified with Zeus, Yam with Poseidon and Mot with Hades.
While Baal Hadad was the lead god in Ugarit, in the Baal cycle it is Ym who is favored by El, and he even briefly rules over the other gods. Baal only rises to power after vanquishing him with the help of his allies Kothar-wa-Khasis, Astarte and Anat. Yam's ultimate fate is unclear, as the text makes references to both death and captivity, and in later sections of the myth Baal talks about Yam as if he was still alive and a possible threat. While in the past researchers, especially those belonging to the myth-ritual tradition, interpreted the myths of Baal, Ym and Mot as a representation of the cycle of seasons and thus related to fertility rites, this view is challenged in more recent scholarship as incorrect or simplistic.
His name comes from the Canaanite word Yam, meaning "Sea."
"A dragon that appears in ancient Semitic lore of the Palestinian region. He is enemies with Baal, the god of fertility and agriculture. He gains his powers by dwelling underwater and ruling the seas and rivers, where he causes floods. Baal defeated him, but since there are similarities to Tiamat's death at Marduk's hands in Babylonian lore, some believe that Ym and Tiamat are the same being."