ALMA and Hubble Space Telescope views of the distant dusty galaxy A2744_YD4