There are three vending machines in Yume Nikki, found in the Dense Woods A, Hell, and the Docks A from which the player can buy 'health drink' to increase Madotsuki's HP.
Yen
Yen is the currency required to operate vending machines, and has no other function in the game.
Yen is acquired by killing NPCs with the Knife effect. Most killable NPCs give a 1 in 8 chance of yielding 100 yen when killed with the knife, except for Organoid in the Sky Garden that always produces yen every time it is killed, and the Goblins in the castle room of the FC House, with the small ones having a 1 in 4 chance, and the big one having a 50% chance of yielding 200 Yen instead.
The amount of yen in your possession can be checked in the pause menu in the bottom-left corner of the screen. The fact that yen is acquired while dreaming, but stays in your menu after "waking up" may indicate that Madotsuki is always dreaming, or could just be a remnant from the game's engine.
Health
Vending machines sell pink drinks that increase your hit points, represented as hearts in the pause menu. However, there is no practical benefit from this as there are no damage hazards that can physically hurt Madotsuki in her dreams. Therefore, there is no need at any point in the game to increase Madotsuki's HP other than for personal satisfaction of the player, or as a mark on the save data window. The reason for its inclusion is that Yume Nikki was made in RPG Maker, in which is hard to remove the health system from a game.
Variations between vending machines
Dense Woods A
The vending machine here dispenses a small can of 'health drink'. It costs 100 Yen and increases HP and max HP by 1 point.
Hell
The vending machine here dispenses a medium bottle of 'health drink'. It costs 130 Yen and increases HP and max HP by 1 point, and has a 33% chance of increasing them by an additional 1 point.
The Docks A
The vending machine here dispenses a larger bottle of 'health drink'. It costs 150 Yen and increases HP and max HP by 1 point, and has a 50% chance of increasing them by an additional 1 point.
Gallery
A vending machine in the manga