If you make sure that in the previous year the accumulated YTD Net Income is zero, the balance of 0510 will also remains zero. The retained earnings account just accumulates the net income over years.
By the way it's possible to change the account to be used as retained earnings account in the General Ledger Preferences
... View more