Degenerate higher order scalar-tensor theories beyond Horndeski up to cubic order