New York lawmakers reach deal to legalize use of marijuana by adults