Implemented sparce A and B vectors input