Tracing the nature of dark energy with galaxy distribution