Drawing without Vertex Buffer Object

I am trying to draw without vertex buffer object but nothing is drawn. I do not know where I did wrong. I use Qt and OpenGL ES 2.0. This is my code:

Code :

glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,1);
glEnableVertexAttribArray(m_posAttr);
glEnableVertexAttribArray(m_distLocation);
glVertexAttribPointer(m_posAttr, 2, GL_FLOAT, GL_FALSE, vertices.size()*3 * sizeof(float), &vertices[0]);
int offset = 2 * sizeof(float);
glVertexAttribPointer(m_distLocation, 1, GL_FLOAT, GL_FALSE, 0, (void*)offset);
glBindAttribLocation(m_program.programId(), m_posAttr, "posAttr" );
glBindAttribLocation(m_program.programId(), m_distLocation, "distance" );
glUniform1i(m_patternLocation, -1);
glUniform4fv(m_colorAttr, 1, vColor);
glUniform1f(m_depthAttr, 0.2f);
glDrawElements(GL_TRIANGLES,indices.size(), GL_UNSIGNED_SHORT, &indices[0] );

where vertices are vector of size 3 containing x and y coordinate and distance for each coordinate. Distance is used to do some calculations in shader.

Any idea what I did wrong?