Android error : java.lang.NullPointerException: Attempt to invoke virtual method

Trying to go to next activity on a button click.also some data is passed with the intent.I have an error in android :

08-18 07:03:52.979 10587-10587/? E/AndroidRuntime: FATAL EXCEPTION:
main
Process: com.example.anjana.crmapp, PID: 10587
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.anjana.crmapp/com.example.anjana.crmapp.MainActivity}:
java.lang.NullPointerException: Attempt to invoke virtual method
‘android.view.View android.widget.Button.findViewById(int)’ on a null
object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method
‘android.view.View android.widget.Button.findViewById(int)’ on a null
object reference
at com.example.anjana.crmapp.MainActivity.onCreate(MainActivity.java:24)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

MainActivity.java :

package com.example.anjana.crmapp;

import android.app.Activity;
import android.content.Intent;
import android.provider.ContactsContract;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class MainActivity extends Activity {

    Button btnYes, btnNo;
    ImageButton btnGood,btnAvg,btnPoor;

    int ans;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnYes = (Button) btnYes.findViewById(R.id.btnYes);
        btnNo = (Button) btnNo.findViewById(R.id.btnNo);
        btnGood=(ImageButton) btnGood.findViewById(R.id.btnGood);
        btnAvg=(ImageButton) btnAvg.findViewById(R.id.btnAvg);
        btnPoor=(ImageButton) btnPoor.findViewById(R.id.btnPoor);

        btnGood.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                ans=1;

            }
        });
        btnAvg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                ans=2;

            }
        });
        btnPoor.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                ans=3;

            }
        });

        btnYes.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                //Intent yesIntent=new Intent();
                //yesIntent.putExtra("ans",ans);
                //startActivity(yesIntent);

            }
        });

        btnNo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent noIntent=new Intent(getApplicationContext(),Contact.class);
                noIntent.putExtra("ans",ans);
                startActivity(noIntent);

            }
        });

    }
}

activity_main.xml :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.anjana.crmapp.MainActivity"
    android:weightSum="1">

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="37dp"
        android:layout_weight="0.25"
        android:fontFamily="sans-serif"
        android:text="Rate your overall experience /n with our service"
        android:textAlignment="center"
        android:textColor="@color/colorPrimaryDark"
        android:textSize="24sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <ImageButton
        android:id="@+id/btnGood"
        android:layout_width="125dp"
        android:layout_height="100dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/textView"
        android:layout_marginLeft="17dp"
        android:layout_marginStart="17dp"
        android:layout_marginTop="48dp"
        app:srcCompat="@drawable/good" />

    <ImageButton
        android:id="@+id/btnAvg"
        android:layout_width="125dp"
        android:layout_height="100dp"
        android:layout_alignBottom="@+id/btnGood"
        android:layout_centerHorizontal="true"
        app:srcCompat="@drawable/average" />

    <ImageButton
        android:id="@+id/btnPoor"
        android:layout_width="125dp"
        android:layout_height="100dp"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/btnAvg"
        android:layout_marginEnd="20dp"
        android:layout_marginRight="20dp"
        app:srcCompat="@drawable/poor" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:fontFamily="sans-serif"
        android:text="Good"
        android:textColor="@android:color/background_dark"
        android:textSize="18sp"
        android:textStyle="bold"
        android:layout_below="@+id/btnGood"
        android:layout_alignLeft="@+id/btnGood"
        android:layout_alignStart="@+id/btnGood"
        android:layout_marginLeft="27dp"
        android:layout_marginStart="27dp" />

    <TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/textView3"
        android:layout_alignBottom="@+id/textView3"
        android:layout_centerHorizontal="true"
        android:fontFamily="sans-serif"
        android:text="Average"
        android:textColor="@android:color/background_dark"
        android:textSize="18sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/textView4"
        android:layout_marginEnd="32dp"
        android:layout_marginRight="32dp"
        android:fontFamily="sans-serif"
        android:text="Poor"
        android:textColor="@android:color/background_dark"
        android:textSize="18sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/textView7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Take part in our feedback survey.."
        android:textAlignment="center"
        android:textColor="@color/colorPrimaryDark"
        android:textSize="22dp"
        android:textStyle="bold"
        android:layout_alignBottom="@+id/textView5"
        android:layout_alignLeft="@+id/textView3"
        android:layout_alignStart="@+id/textView3" />

    <Button
        android:id="@+id/btnYes"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Yes"
        android:layout_marginBottom="76dp"
        android:layout_alignParentBottom="true"
        android:layout_toRightOf="@+id/btnAvg"
        android:layout_toEndOf="@+id/btnAvg" />

    <Button
        android:id="@+id/btnNo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/btnYes"
        android:layout_toEndOf="@+id/textView3"
        android:layout_toRightOf="@+id/textView3"
        android:text="No,Thanks" />


</RelativeLayout>

I really don’t know why this error occurs!please help me…