TORELLI THEOREM FOR GRAPHS AND TROPICAL CURVES