New York legislators OK historic budget plan