function [ys,check] = myfile1_steadystate(ys,exo)

global M_ 

% read out parameters to access them with their name
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = deblank(M_.param_names(ii,:));
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
% initialize indicator
check = 0;


%% Enter model equations here

options=optimset(); % set options for numerical solver

A = 1;
u = (1/betta-1);
q = (1/betta);
pi = pibar;
pistar = ((pi^(1-epsilon)-phi)/(1-phi))^(1/(1-epsilon));
mc = pistar*(epsilon-1)*(1-phi*betta*(pi^epsilon))/(pi*epsilon*(1-phi*betta*(pi^(epsilon-1))));
d = (1-phi)*(pistar^(-epsilon))*(pi^epsilon)/(1-phi*(pi^epsilon));

X = (gd_2+(1-rao2_bar)*gl_2)/(gl_2+gd_2);
U = 2*(rao2_bar^2)/(gl_2+gd_2)-(X^2)*(1/gl_1+1/gd_1);
V = (rao2_bar^2)/(gl_2+gd_2)-X/gl_1-(1-rao1_bar)*X/gd_1;
W= (rao2_bar/(gl_2+gd_2)-X/gl_1)/U+1/(gl_1*V);
Z = (M-(1-rao1_bar)*u/gd_1)/V+(rao2_bar*u/(gl_2+gd_2)+X*u/gd_1)/U;
r = Z/W;
r_i = (rao2_bar*(r-u)/(gl_2+gd_2)-X*(r/gl_1+u/gd_1))/U;
L_1 = (r-X*r_i)/gl_1;
D_1 = (X*r_i-u)/gd_1;
ib = (rao2_bar^2)*r_i/(gl_2+gd_2);
L_2 = ((r-u-rao2_bar*r_i)-gd_2*(L_1-D_1))/(gl_2+gd_2);
L = L_1+L_2;
D = L;
D_2 = D-D_1;

[w,~,exitflag1]  = fzero(@(w)((((1/(d*mc*(1-alppha))-delta*(w^(1/alppha-1))...
    /((mc*(1-alppha))^(1/alppha)))*(1-h)*ksiN/(1-betta*h))^(-1/(eta+1)))*...
    (w/(mc*(1-alppha)))^(1/alppha))*((alppha*(mc*((1-alppha)/w)^(1-alppha))^(1/alppha))-q+1)-L*(r-q+1),...
    13,options); 
if exitflag1 <1
    return; %return without updating steady states
end

R = alppha*(mc*((1-alppha)/w)^(1-alppha))^(1/alppha);
N = ((1/(d*mc*(1-alppha))-delta*(w^(1/alppha-1))/((mc*(1-alppha))^(1/alppha)))*(1-h)*ksiN/(1-betta*h))^(-1/(eta+1));
k = N*(w/(mc*(1-alppha)))^(1/alppha);
i = delta*k;
lamda = ksiN*(N^eta)/w;
c = (1-betta*h)/((1-h)*lamda);
y = c+i;

F = k-L;

h1 = lamda*mc*y/(1-phi*betta*(pi^epsilon));
h2 = lamda*y/(1-phi*betta*(pi^(epsilon-1)));



%% end own model equations

for iter = 1:length(M_.params) %update parameters set in the file
  eval([ 'M_.params(' num2str(iter) ') = ' M_.param_names(iter,:) ';' ])
end

NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
  varname = deblank(M_.endo_names(ii,:));
  eval(['ys(' int2str(ii) ') = ' varname ';']);
end
