No, the baby Yanma won't know Hypnosis. A Pokemon's level up moves are only passed to the child if both parents know them. Since Ditto can't learn Hypnosis, the child won't know Hypnosis - you'll have to level up Yanma to learn it.
Ditto cant learn hypnosis. But yes, the offspring will have hypnosis in its moveset